Disable Router Query Params?
I'm upgrading to Refine v4 and the latest React Router v6 with BrowserRouter. Somehow there are new filter parameters being passed along and injected into my dataProvider hooks, and they are usually invalid filters. How can I turn those off?
7 Replies
Hi @geoffatsource. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
In Refine v4, you can disable server-side filtering by setting the
filters.mode
to "off"
in the useTable
hook. Here's how you can do it:
This will prevent any filter parameters from being passed to your dataProvider
hooks.
For more information, you can refer to the Refine React Table documentation (https://refine.dev/docs/packages/documentation/react-table/).
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@1014305963219615754> kapa.ai is still learning and improving, please let us know how it did by reacting below
quickest-silver•12mo ago
@kapa.ai I want to disable query parameters globally in my app to prevent query string injection
Let me check the knowledge base for you. One moment! :books:
----------------------
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:
For more information, you can refer to the Refine documentation (https://refine.dev/docs/core/components/refine-config).
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@1014305963219615754> kapa.ai is still learning and improving, please let us know how it did by reacting below
optimistic-gold•11mo ago
Hello @geoffatsource was the bot's answer sufficient for you?
quickest-silver•11mo ago
Yes thanks