Closed tomsontom closed 2 years ago
I'm unable to reproduce this problem when I just copy it to the storybook -so to reproduce you really need to boostrap a react app and put the code in there.
@tomsontom Just wanna clarify, this happens for you after you do https://github.com/adobe/react-spectrum/issues/977#issuecomment-690299692 correct? I noticed that the issue in https://github.com/adobe/react-spectrum/issues/977 actually goes away for me when I removed the wrapping <React.StrictMode>
that @christian-baumann has in the sample app so do you happen to have the same wrapping <React.StrictMode>
in your app? If so, does the above refresh issue happen when you remove it?
Not saying the fix is to remove strict mode, just wanna make sure what the reproduction steps are here.
this is right - if i remove the <React.StrictMode>
things start working
See also #779
Closing in favor of the umbrella strict mode issue https://github.com/adobe/react-spectrum/issues/779
๐ Bug Report
Change the ListData created through useListData() with APIs like remove/append/... does not refresh the visuals
๐ค Expected Behavior
Modifying the data list refreshes the List rendered in the browser window
๐ฏ Current Behavior
List is rerendered until the container size changes (eg by resizing the window).
๐ Possible Solution
๐ฆ Context
I encountered this while looking into #977 and I guess this could also be the reason old data gets fed into useOptions.
๐ป Code Sample
๐ Your Environment
๐งข Your Company/Team
๐ท Tracking Issue (optional)