Skip to content

Instantly share code, notes, and snippets.

@StoneCypher
Created January 13, 2016 06:07
Show Gist options
  • Select an option

  • Save StoneCypher/6cb05bef1f05c7b32f77 to your computer and use it in GitHub Desktop.

Select an option

Save StoneCypher/6cb05bef1f05c7b32f77 to your computer and use it in GitHub Desktop.
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}/>);
@throoze
Copy link
Copy Markdown

throoze commented Jan 13, 2016

Thanks a lot you dude!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment