Last active
June 8, 2016 19:23
-
-
Save bryceosterhaus/a5fb1b13f39c985acf46ac6d9454ecb3 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 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