Allow to specify the key
prop in the TreeNodeData type
#7154
alessandrojcm
started this conversation in
Feature requests
Replies: 1 comment
-
This issue is not related to key prop in React. Actions on tree items are performed based on their value. You can treat value as key in the current implementation – it must be unique. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there!
Long time Mantine user here, really loving the new Tree component, it came it handy just at the right time. I was just using it today and I realized the
key
prop for the tree nodes are inferred from the prop value. I was having this weird bug there clicking a leaf node will collapse its parent, I then realized the node.Now I understand that this was my fault as I was not ensuring the node values were unique, however I believe it would be a good idea (unless there is something I am missing) to expose the
key
prop to allow users to manually set their keys, and it could default to the node value. Happy to make this PR, too, if that's ok.Thanks!
Beta Was this translation helpful? Give feedback.
All reactions