just copy and paste the code and run then do edit like message, alert, id and class name to understand the code.
this code does not require npm.
<html>
<head>
<title>React App</title>
<script src=”https://unpkg.com/react@16/umd/react.production.min.js”></script>
<script src=”https://unpkg.com/react-dom@16/umd/react-dom.production.min.js”></script>
<script src=”https://unpkg.com/babel-standalone@6.15.0/babel.min.js”></script>
</head>
<body>
<div id=”mycode”>
</div>
<script type=”text/babel”>
function Test() {
const hello = () => { alert(“Hello React”) }//arrow function
return <button onClick={hello}>Click Me</button>//call functin on click hear
}
class Admin extends React.Component {
render() {
return <div>My First React Code <Test /></div>//output of render function
}
}
ReactDOM.render(<Admin />, document.getElementById(‘mycode’))///render code and show on id=mycode
</script>
</body>
</html>