I cannot figure out what is I'm making wrong. Also I had read a several questions on the SOF, but any of them is do not suits me.
I have a stack of errors:
Line 3: 'React' must be in scope when using JSX react/react-in-jsx-scope
Line 4: 'React' must be in scope when using JSX react/react-in-jsx-scope
Line 5: 'React' must be in scope when using JSX react/react-in-jsx-scope
Line 9: 'ReactDOM' is not defined no-undef
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://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-dom.min.js"></script>