You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That is due to everytime you select an option, selectedItems changes and rerenders the component creating new references for data. Since selectedItems is an array of JS references they are not going to the same references as data anymore. If you move data outside of the export default function Example() {}, you'll see it works normally.
Best practice in these cases is to pass in data as a prop to your component that way it doesn't create new references.
When I select the checkbox, I don't get the active checkbox state, resulting in multiple duplicated selected items.
Source :
The text was updated successfully, but these errors were encountered: