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
2 Respostas
+ 2
you're missing babel
try this:
https://code.sololearn.com/WwCd71SJ9W56/?ref=app
+ 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