You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently I rewrite my modal manager from react-router, where everything works fine. I use history to change private state, and Inertia rerenders whole page, even I didn't change its state
Steps to reproduce:
When I open modal I call history.pushState({...history.state, modal: modal.id}, ''); hence I keep all Inertia data.
Later, when I click browser back button or call history.go(-1) I close modal on POP event.
But with this action, current page fully rerenders all components and of cource triggers useEffect(() => {}, [])
Thankfully, it's coming at least without calling to backend.
Thank you!
The text was updated successfully, but these errors were encountered:
@shengslogar, problem not with data storing, but with returning back without side effect.
router.remember(data, 'my-key') is replaces state, not pushes new, as I just tested. I can't return back to same page with it
Hey! Manually using history.pushState is not currently supported with Inertia.js.
That said I hope to eventually add the ability to make client-side only visits using an API like Inertia.push().
My recommendation right now would be to use Inertia props to open/close a dialog like this. Yes that means hitting the server, but, at least at this time, that's the "Inertia way" 👍
Version:
@inertiajs/react
version: 1.0.15Describe the problem:
Currently I rewrite my modal manager from react-router, where everything works fine. I use history to change private state, and Inertia rerenders whole page, even I didn't change its state
Steps to reproduce:
When I open modal I call
history.pushState({...history.state, modal: modal.id}, '');
hence I keep all Inertia data.Later, when I click browser back button or call
history.go(-1)
I close modal on POP event.But with this action, current page fully rerenders all components and of cource triggers
useEffect(() => {}, [])
Thankfully, it's coming at least without calling to backend.
Thank you!
The text was updated successfully, but these errors were encountered: