-
-
Save reime005/f49b4476183e60034cfef74670b99e5a to your computer and use it in GitHub Desktop.
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
class MyComponents extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
test: 42 | |
}; | |
this.renderSomeText = this.renderSomeText.bind(this); | |
} | |
// you could also do this, so no constructor needed | |
state = { | |
test: 42, | |
} | |
renderSomeText() { | |
return <text>this.state.test</text> | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment