Cannot update URLSearchParam states with useShallow/shallow #2392
-
Hi, I've recently encountered an issue where the state typed as URLSearchParams isn't updating correctly. When I use the I suspect the issue could be related to shallow.ts. In the following example, for it to function correctly, it should return false, yet it returns true. const a = new URLSearchParams({'hello': 'world'});
const b = new URLSearchParams({'zustand': 'shallow'});
console.log(shallow(a, b)); // true Could this behavior be due to a problem in the shallow comparison logic? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Well, in general, I think shallow has been supporting basically plain objects. Map/Set are added lately. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/iterator Would anyone like to give a try? |
Beta Was this translation helpful? Give feedback.
Done in #2427