use-query-params icon indicating copy to clipboard operation
use-query-params copied to clipboard

removeDefaultsFromUrl: true doesn't take equals into account

Open meros opened this issue 3 years ago • 2 comments

In removeDefaults.ts, I would expect equals to be used (if defined) to check for equality between default and encoded value. If there is no equals, shallowEqual should be used instead.

Now, when I set a value that is not ===, but equals() to the default, the param is still present in the URL for no reason.

meros avatar Apr 28 '23 13:04 meros

+1. I'm using the withDefault(NumericArrayParam, [0, 100]); with the removeDefaultsFromUrl but it is not removed from the URL when the value did not change.

juancho11gm avatar May 09 '23 15:05 juancho11gm

Yes same on my side :) Would definitely make sense to remove from params

chrisbag avatar Nov 22 '23 15:11 chrisbag