react-ui-tree
react-ui-tree copied to clipboard
Active node callback method
While using react-ui-tree for internal project I noticed limit on how you can style nodes inside generated tree. I now that renderNode method callback can be used to render custom markup/component for node but problems start when i wish to style the full node item, not just the inner part.
To fix this I added isActiveNode(node) callback method. Method should return true/false and if true is-active class is added to the selected m-node element. With this we can now apply custom styles for active nodes.
It would be cool if we can work in merging this and publishing new version to NPM because other departments in our team also use the library inside their code.
Changes:
- added isActiveNode method to root component
- added calls for isActive method and class toggle inside Node component
- updated readme