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.
Answered by
Southclaws
Aug 6, 2024
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.
2 replies
Answer selected by
franky47
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
setEditing(null) seems like the best way, hopefully this helps someone with the same question!