-
-
Notifications
You must be signed in to change notification settings - Fork 6
feat: include nodePath as argument to template functions in TreeView nodes #48
New issue
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
Conversation
@joaoassisb after analysing this PR I decided to revert your previous commit. I think you should work more in the proposal and describe what use cases this feature will enable. |
@assisrafael the use case is to simplify the usage of TreeViews with Forms. At the moment, the template function passes only the item,index and parentItem, making a lot harder to handle paths and possible changes. I updated the TreeViewExample to illustrate better my use case. |
Your use case make sense. |
src/treeview/TreeView.jsx
Outdated
@@ -32,6 +32,7 @@ function TreeNodes({ childrenPath, depth, draggable, nodes, parentNode, template | |||
childrenPath={childrenPath} | |||
depth={depth} | |||
draggable={draggable} | |||
relativePath={relativePath ? `${relativePath}[${index}]` : `[${index}]`} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using a ternary here you could set ""
as the default value for the prop
No description provided.