How to manipulate browser url in Inertia.js? #1163
Replies: 3 comments 4 replies
-
I used something like |
Beta Was this translation helpful? Give feedback.
-
I had the same issue, and solved it like this: instead of using you need to update the router object in inertia like this:
then when inertia decide to do its nonsense things are still there |
Beta Was this translation helpful? Give feedback.
-
I had the same issue and needed to not add to the history. I was using Uncaught (in promise) TypeError: Cannot read properties of null (reading 'page') Then I found the documnentation for Inertia here] : https://inertiajs.com/manual-visits#browser-history and changed my line to this which fixed my issue : import { router } from "@inertiajs/vue3";
//...
router.visit(newUrl, {replace: true, preserveState: true}); |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I've been using an IntersectionObserver to update the url of my SPA while the user scrolls down the page like so:
but how do I do this in Inertia.js since it doesn't have the router.push method? I'm using Inertia with a Vue 3 frontend.
Beta Was this translation helpful? Give feedback.
All reactions