We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
demo
The text was updated successfully, but these errors were encountered:
You haven't specified the style for the root div in the Node component. You have the following code:
style
div
Node
const Node = ({ data: { isLeaf, name }, isOpen, style, toggle }) => ( <div style={style}> {!isLeaf && ( <button type="button" onClick={toggle}> {isOpen ? "-" : "+"} </button> )} <div>{name}</div> </div> );
To make it working, you should change it in the following way:
const Node = ({ data: { isLeaf, name, nestingLevel }, isOpen, style, toggle }) => ( <div style={{ ...style, alignItems: 'center', display: 'flex', marginLeft: nestingLevel * 30 + (isLeaf ? 48 : 0), }}> {!isLeaf && ( <button type="button" onClick={toggle}> {isOpen ? "-" : "+"} </button> )} <div>{name}</div> </div> );
You can also do it using CSS. Demo code uses the direct style assigning just because it is faster and easier to show the main approach.
Sorry, something went wrong.
If you have any further questions, feel free to reopen the issue!
No branches or pull requests
demo
The text was updated successfully, but these errors were encountered: