Learn the fundamentals of React, including simple and class components, state, props, and submitting form data.
Ticking Clock Example
<div id="root"> | |
</div> |
function tick() { | |
const element = ( | |
<div> | |
<h1>Hello world!</h1> | |
<h2>It is {new Date().toLocaleTimeString()}.</h2> | |
</div> | |
); | |
ReactDOM.render(element, document.getElementById("root")); | |
} | |
setInterval(tick, 1000); |
<script src="https://unpkg.com/react/umd/react.development.js"></script> | |
<script src="https://unpkg.com/react-dom/umd/react-dom.development.js"></script> |