Created
July 10, 2018 16:48
-
-
Save marensas/e821fe383365ff8e40db9180992edb54 to your computer and use it in GitHub Desktop.
React state example
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
import React from 'react'; | |
class Something extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
foo: 'bar', | |
}; | |
} | |
render() { | |
return this.state.foo; | |
} | |
} | |
export default Something; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment