wrong compile result in jsx
See original GitHub issuesource
const Ob = (props) => {
return <div>{props.r()}</div>
}
const App = () => {
return <h2>
hello
<Ob r={() => {
return <h1>zzzz</h1>
}}/>
</h2>
}
ReactDOM.render(
<App/>,
document.getElementById('root')
);
output:
"use strict";
const Ob = (props) => {
return React.createElement("div", null, props.r())
}
const App = () => {
return React.createElement("h2", null, "hello\r\n ",
React.createElement(Ob, {r: true}, // =================> why ?
React.createElement("h1", null, "zzzz")))
}
ReactDOM.render(
React.createElement(App, null),
document.getElementById('root')
);
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
React compile error using "create-react-app" - Stack Overflow
Save this question. Show activity on this post. I am suffering compile failure using "create-react-app".
Read more >JSX In Depth - React
React Must Be in Scope Since JSX compiles into calls to React. createElement , the React library must also always be in scope...
Read more >Documentation - JSX - TypeScript
TypeScript supports embedding, type checking, and compiling JSX directly to ... but <bar /> will result in an error since it has not...
Read more >8 common React error messages and how to address them
This warning will often present after you've made a habit of including a key prop with the resulting JSX from a list. import...
Read more >@mdx-js/mdx | MDX
Whether to keep JSX ( boolean? , default: false ). The default is to compile JSX away so that the resulting file is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for reply .
I think this project has huge potential. Especially when using in small/demo projects. i used htm.js before , Hope this is getting better and better
Thank you for implementing this library .
Thanks and thanks for your help testing!
I just published a new release
5.10.3
that includes this fix. I gave you credit in the CHANGELOG.md file for finding and helping with this issue.