Clearing search params does not work on mount?
I have a search params validation when i get ids of some stuff, then in the component i get this ids from useSearch and check if this ids exist in API resposone.
if yes i keep the search params and do other actions
if no i wanna clear the params
everything works fine but when i enter directly by the link the clearing function does not work for some reason
route file:
clearing function:
But if i wrap this functuion inside timeout 0 it work.
this clearParams fn fire inside a useeffect
1 Reply
eastern-cyan•10mo ago
can you please create a complete minimal example by forking one of the existing examples on stackblitz?