-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fix useTreeData error and types #6923
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
Co-authored-by: Reid Barber <reid@reidbarber.com>
}); | ||
|
||
<ListBox | ||
aria-label="List organisms" | ||
items={tree.items} | ||
selectedKeys={tree.selectedKeys} | ||
onSelectionChange={tree.setSelectedKeys}> |
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.
I could solve this one in the example instead if useTreeData doesn't have and shouldn't have the same notion for 'all'
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.
Theoretically this is also a breaking change to the types, since people would now have to account for 'all'
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.
I think we should punt on supporting all
for now unless we are comfortable bumping a major since this is a breaking change. I actually ran into something similar for useTreeState where it doesn't support all
either and we decided to punt (and potentially create a new hook?): #5756 (review)
I imagine useTreeData will need to be updated pretty heavily in the future when we get to DnD for tree like structures (I ran into a lot of issues when using it with Table sections in https://github.com/adobe/react-spectrum/pull/4444/files), should we wait till then or do you think bumping a major now would be easiest?
Closes #1940
This would've come up for ts strict as well most likely
✅ Pull Request Checklist:
📝 Test Instructions:
🧢 Your Project: