Clear the query upon falsy value (or custom) #597
-
Hey! Quick question, I'm using query state to drive edit mode for a page, so ?edit=true enables editing controls. What I'd like to do is simply remove this query parameter entirely when it's set to false, in order to ensure the parameter ?edit=false is not left in the URL when users copy-paste the URL. Is this possible to either treat falsy values as "clear the parameter entirely" or some way I can achieve this behaviour through serialising hooks? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
setEditing(null) seems like the best way, hopefully this helps someone with the same question! |
Beta Was this translation helpful? Give feedback.
setEditing(null) seems like the best way, hopefully this helps someone with the same question!