How to use React with a CDN | SoloLearn: Learn to code for FREE!


How to use React with a CDN

I'm trying to use React in Brackets. I am using a CDN and using the same technique as Sololearn: //</script><script type="text/babel"> ReactDOM.render( <h1>Hello!</h1>, document.getElementById("root") ) But it keeps coming up with errors like "ReactDOM is used before assignment", when I used const it said "const is a reserved word". How can I get React to work with babel script and React cdns

9/3/2019 10:44:08 AM

Clueless Coder

1 Answer

New Answer


You should not use following format for react that run on html/js files //</script><script type="text/babel"> You should use following format instead: <script type="text/babel"> ReactDOM.render( <h1>Hello!</h1>, document.getElementById("root") ) </script> Remember to include react, react-dom abd babel js in head tag