0

I have syntaxError Unexpected token '<' line 17. Thank you

I want to render paragraph hello. I have syntaxError Unexpected token https://code.sololearn.com/W6IYECHtrb5c/?ref=app

7th Nov 2023, 9:50 AM
Malick Diagne
Malick Diagne - avatar
2 Réponses
+ 2
7th Nov 2023, 11:25 AM
Bob_Li
Bob_Li - avatar
+ 1
the url must be written in the opening script tag. You also need to download the "babel" library. In the script of your code, you need to register the type "text/babel". Your code with changes: <!DOCTYPE html> <html> <head> <title>Page Title</title> <script src="https://unpkg.com/react@16.14.0/umd/react.development.js"> </script> <script src= "https://unpkg.com/react-dom@16.14.0/umd/react-dom.development.js"> </script> <script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script> </head> <body> <div id="root"></div> <script type="text/babel"> const container = document.getElementById ('root'); ReactDOM.render (<p>Hello</p>, container); </script> </body> </html> Here you will find many examples on React: https://www.sololearn.com/post/416342/?ref=app
7th Nov 2023, 8:59 PM
Solo
Solo - avatar