+ 7
How to run React JS codes on Code Playground?
I'm receiving errors after transferring the sample codes of React JS to the Code Playground. I already mentioned the CDN files for the React.
7 Respuestas
+ 8
JSX cannot directly run from Javascript. You need babel to compile JSX to Js.
Try add
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
<script type="text/babel">
// React JSX code here
</script>
And dont include both minify React-dom file with React-dom file.
+ 22
What errors do you receive?
Please, post your code here, so we can help you.
+ 20
You forgot to use backticks. Surround your tags with backticks in the JavaScript section, like this:
`<h1>Hello, {props.name}</h1>`
+ 7
Burey has a template that you can use for this kind of thing. I have used it with my codes and so far I have no problems:
https://code.sololearn.com/Wi772Mr81mX8/
+ 4
Mickel Thanks for this! I'll try this one.
+ 3
Igor Makarsky
This is the code:
https://code.sololearn.com/WMRseBoGdj1g/?ref=app
+ 3
Wow, it perfectly work now! Thank you Calviղ !