InertiaJS router.get request with params not preserving state: always full refreshing page #1966
Unanswered
andcl
asked this question in
Help (React)
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In the docs, we can find:
State preservation
...
You can instruct Inertia to preserve the component's state when using the
getmethod by setting thepreserveStateoption totrue....
I use this in my React application precisely for searching & filtering rows in, for example, a datatable.
For that, I have binded that
searchstring to a text input content, so changing it launches a GET request that, in turn, changes the URL, e.g.http://localhost/example?search=Johnny. And because of that URL change, Inertia then always triggers a full page reload, makingpreserveState: trueoption totally useless in my case...How is the "search functionality" supposed to be implemented then? What am I failing at?
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions