Last active
August 16, 2017 08:28
-
-
Save AkshayRana92/d327799bbbd7a21df24659a1b9019a0b to your computer and use it in GitHub Desktop.
state1
This file contains 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
import React, { Component } from 'react'; | |
class MyComponent extends Component { | |
constructor() { | |
super(); | |
this.state= {name: 'Say my name'}; | |
setInterval( | |
() => { | |
this.setState({name: 'Heisenberg'}) | |
}, | |
2000 | |
); | |
} | |
render() { | |
return ( | |
<h1>{this.state.name}</h1> | |
); | |
} | |
} | |
export default MyComponent; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment