Keep these below files in a webserver or create live-server, node express to keep this application running
npm install global live-server
public/index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>my wish list</title>
</head>
<body>
<div id="app"></div>
<script src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
<script src="/scripts/app.js"></script>
</body>
</html>
/public/scripts/app.js
let template = React.createElement('h1', null, 'Welcome to react');
appRoot = document.getElementById("app");
ReactDOM.render(template, appRoot);
No comments:
Post a Comment