Skip to content

Instantly share code, notes, and snippets.

@sagar-gavhane
Created July 1, 2018 10:41
Show Gist options
  • Save sagar-gavhane/8a6d8783da19ff9748f15fa5778eac1c to your computer and use it in GitHub Desktop.
Save sagar-gavhane/8a6d8783da19ff9748f15fa5778eac1c to your computer and use it in GitHub Desktop.
JSX Control State IFEE
class JsxControls extends Component {
constructor(props) {
super(props);
this.state = {
counter: 100
}
}
render() {
return (
<div className="App">
{
(() => {
if (this.state.counter === 100) {
return <p>Blah</p>;
} else {
return <p>Herp</p>;
}
})()
}
</div>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment