I'm reading this tutorial about React.
I try to do this example. This is my code:
import React from 'react'
export default class App extends React.Component {
render() {
function tick() {
const element = (
<div>
<h1>Hello, world!</h1>
<h2>It is {new Date().toLocaleTimeString()}.</h2>
</div>
);
}
return (
setInterval(tick, 1000)
);
}
}
It doesn't work, I get no errors, but it doesn't do what it should.
The error I get is:

