How to run React JS codes on Code Playground? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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.

27th Jun 2018, 12:12 AM
Email Not Activated
7 Answers
+ 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.
27th Jun 2018, 1:24 AM
Calviղ
Calviղ - avatar
+ 22
What errors do you receive? Please, post your code here, so we can help you.
27th Jun 2018, 12:41 AM
Igor Makarsky
Igor Makarsky - avatar
+ 20
You forgot to use backticks. Surround your tags with backticks in the JavaScript section, like this: `<h1>Hello, {props.name}</h1>`
27th Jun 2018, 12:50 AM
Igor Makarsky
Igor Makarsky - avatar
+ 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/
27th Jun 2018, 2:00 AM
Mickel
Mickel - avatar
+ 4
Mickel Thanks for this! I'll try this one.
27th Jun 2018, 2:35 AM
Email Not Activated
27th Jun 2018, 12:45 AM
Email Not Activated
+ 3
Wow, it perfectly work now! Thank you Calviղ !
27th Jun 2018, 1:35 AM
Email Not Activated