Created
January 13, 2016 06:07
-
-
Save StoneCypher/6cb05bef1f05c7b32f77 to your computer and use it in GitHub Desktop.
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
| var example = [ | |
| 'example 1a', | |
| [ | |
| 'example 2a', | |
| [ | |
| [ | |
| 'example 3' | |
| ] | |
| ] | |
| 'example 2b', | |
| [ | |
| [ | |
| 'the numbering system broke here', | |
| 'beer' | |
| ] | |
| ] | |
| ], | |
| 'example 1b' | |
| ]; | |
| var Recurse = React.createClass({ | |
| render: function() { | |
| return <div>{this.props.example.map( | |
| X => (typeof X === 'string')? | |
| <div>{X}</div> | |
| : X.map(Z => <Recurse example={Z}/>) | |
| )}</div>; | |
| } | |
| }); | |
| React.render(document.body, <Recurse example={example}/>); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks a lot you dude!