Created
November 14, 2019 17:39
-
-
Save guaracyalima/5248960723b6bf04fc52cc6f50379b9f to your computer and use it in GitHub Desktop.
Ciclo de vida do react - render
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Clock extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = {date: new Date()}; | |
} | |
render() { | |
return ( | |
<div> | |
<h1>Hello, world!</h1> | |
<h2>It is {this.state.date.toLocaleTimeString()}.</h2> | |
</div> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment