mirror of
https://github.com/github/codeql.git
synced 2025-12-21 19:26:31 +01:00
17 lines
360 B
JavaScript
17 lines
360 B
JavaScript
class Clock extends React.Component {
|
|
constructor(props) {
|
|
super(props);
|
|
this.state = { };
|
|
}
|
|
|
|
render() {
|
|
// BAD: this.state.date is undefined
|
|
var now = this.state.date.toLocaleTimeString();
|
|
return (
|
|
<div>
|
|
<h2>The time is {now}.</h2>
|
|
</div>
|
|
);
|
|
}
|
|
}
|