Skip to content

Instantly share code, notes, and snippets.

@bryceosterhaus
Last active June 8, 2016 19:23
Show Gist options
  • Save bryceosterhaus/a5fb1b13f39c985acf46ac6d9454ecb3 to your computer and use it in GitHub Desktop.
Save bryceosterhaus/a5fb1b13f39c985acf46ac6d9454ecb3 to your computer and use it in GitHub Desktop.
class Foo extends Component {
render() {
return (
<div>
{this.size}{this.config.foo}
</div>
)
}
}
Foo.STATE = {
size: {
value: 0
}
}
class Bar extends Component {
render() {
return (
<div>
Conditional Bar
</div>
)
}
}
class TestApp extends Component {
getFoo() {
return (
<Foo size="1" />
);
}
getFooBar() {
return (
<div>
<Foo foo="bar" size="2" />
</div>
);
}
render() {
return (
<div>
<button
data-onclick={
() => {
this.index = !this.index;
}
}
>
click me
</button>
<div>
<div class="">
{this.index &&
<Bar />
}
<a>
{this.getFoo()}
</a>
{this.getFooBar()}
</div>
</div>
</div>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment