how to remove query from Next js 13 app url without reloading?
how to remove query from next js 13 app url without reloading?
1 Reply
If you're fine with soft navigations, the useRouter hook should work. If not, you can change the URL by assigning a new value to document.location.search(Probably a good idea to create the value you'll use with
new URLSearchParams(window.location.search)
).