Last active
October 15, 2020 12:43
-
-
Save onurkerimov/4e8c89a27eada02419c430f300a4106a 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
const Tree = (props) => ( | |
<ul> | |
{props.nodes.map((node, key) => ( | |
<li key={key}> | |
<div className={'name'}>{node.name}</div> | |
{node.children && <Tree nodes={node.children} />} | |
</li> | |
))} | |
</ul> | |
); | |
render(<Tree nodes={tree} />, document.getElementById('root')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Alternative syntax that compiles to JS (Inspired by Imba)