React router dom

How to clear params on page reload?
5 Replies
kapa.ai
kapa.ai9mo ago
Hi @hoaanhtuc. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- In Refine, you can disable query parameters globally by setting the syncWithLocation option to false in the <Refine> component. This will prevent the list of query parameters from being modified manually by editing directly in the URL. Here's how you can do it:
import { Refine } from "@refinedev/core";

const App: React.FC = () => {
return (
<Refine
// ...
options={{
syncWithLocation: false,
}}
>
// ...
</Refine>
);
};
import { Refine } from "@refinedev/core";

const App: React.FC = () => {
return (
<Refine
// ...
options={{
syncWithLocation: false,
}}
>
// ...
</Refine>
);
};
This will ensure that on page reload, the URL parameters are not used to set the state of your application, effectively clearing them. Source (https://discord.com/channels/837692625737613362/1165009493378211991) ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai9mo ago
<@617879699363725341> kapa.ai is still learning and improving, please let us know how it did by reacting below
adverse-sapphire
adverse-sapphire9mo ago
@kapa.ai is there any other way, because i still want to use params?
kapa.ai
kapa.ai9mo ago
Let me check the knowledge base for you. One moment! :books: ---------------------- Hmm, I don't know enough to give you a confident answer yet. The information provided in the extracts does not include a method to clear URL parameters on page reload while still using them during normal operation. However, Refine provides extensive documentation that might have the information you're looking for. I recommend checking out the Refine documentation (https://refine.dev/docs) for more detailed information. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai9mo ago
<@617879699363725341> kapa.ai is still learning and improving, please let us know how it did by reacting below