-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
For languages that have a prefix in the url causes full page fetches of the whole html document, instead of separate pages #396
Comments
Hey, try using the Paraglide JS 2.0 beta. |
@samuelstroschein will this work with Nextjs v14? and is it compatible with @inlang/paraglide-next ? |
@timothyman1 yes, works with nextjs14. |
@samuelstroschein the |
@timothyman1 would using
function ActiveLink({ children, href }) {
const router = useRouter()
const handleClick = (e) => {
e.preventDefault()
router.push(localizeHref("/page"))
}
return (
<button onClick={handleClick}>
{children}
</button>
)
} |
Probably not if it's a client side API. You would need to wrap it with |
Using the Prefix strategy in @inlang/paraglide-next, if switching to a language which is not the default one, causing the url path to contain a prefix (for example for german domain/de/smthing) causes every transition to a different page to fully fetch the whoole html document, causing every layout and everything to rerender. It seems like it is happening because there is no dynamic route for the prefix and nextjs returns a 404 for this page path, cause there isnt a path.
Following the docs, it doesnt say to add a dynamic route for this strategy.
in the network tab you can that it falls while fetching a single page and then right after fetches for the whole html document, every layout and eveything to rerender
im using:
The text was updated successfully, but these errors were encountered: