const App = () => {
return (
<p>Hello, World!</p>
)
}
reactjs hello world
===============================
npx create-react-app myapp
cd myapp
npm start
http://localhost:3000/
-----------------------------
* check version
node -v
npm -v
* npm upgrade
npm i -g npm-upgrade
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(<h1>Hello, world!</h1>);
Page HTML :
<div id = "root"> </div>
Page JS BABEL:
ReactDOM.render(<h1> Hello , world ! </h1> , document.getElementById('root') );
const root = ReactDOM.createRoot(
document.getElementById('root')
);
function tick() {
const element = (
<div>
<h1>Hello, world!</h1>
<h2>It is {new Date().toLocaleTimeString()}.</h2>
</div>
);
root.render(element);}
setInterval(tick, 1000);