Rewrite url after data
hook
#1843
Answered
by
rtritto
rtritto
asked this question in
Help & Questions
-
My use case is to rewrite (change/replace) the url (without redirect) after some data are retrieved in the data hook. |
Beta Was this translation helpful? Give feedback.
Answered by
rtritto
Dec 7, 2024
Replies: 2 comments 3 replies
-
I presume you've already seen https://vike.dev/render? |
Beta Was this translation helpful? Give feedback.
3 replies
-
I fixed with: // +Page.tsx
import { onMount } from 'solid-js'
export const Page = () => {
onMount(() => {
if (<SOME_CONDITION>) {
// Update route path (no reload)
globalThis.history.replaceState(null, '', <NEW_URL>)
}
})
return (...)
} Related to this use case, maybe #1846 isn't necessary to implement it. FYI @brillout |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
rtritto
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I fixed with:
Related to this use case, maybe #1846 isn't necessary to implement it.
FYI @brillout