Skip to content

Instantly share code, notes, and snippets.

@imgVOID
Forked from BetterProgramming/passProps.js
Created September 21, 2021 17:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imgVOID/4aebce76acfb26ef16ba730e7722d0fb to your computer and use it in GitHub Desktop.
Save imgVOID/4aebce76acfb26ef16ba730e7722d0fb to your computer and use it in GitHub Desktop.
class Time extends React.Component {
constructor(props) {
super(props);
this.state = {date: date: new Date()};
}
render() {
return (
<div>
<h1>It is {this.state.date.toLocaleTimeString()}</h1>
</div>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment