use-selected-items-hook
use-selected-items-hook copied to clipboard
List of items is not reset when empty array is passed in
Steps to reproduce the issue
- Set initialItems to array with 10 items
- update initialItems with an empty array
What I expected
The "items" value to update to an empty array
What happened instead
The "items" value was the same from step 1
Hey @tlindener, thanks for reporting this issue!
I'm mostly sure it's related to a truthy check on the items
value when updating it - I'll double-check that and open a PR with the fix.