Skip to content
Advertisement

Tag: next-router

No component being rendered on router.push(‘/page’) unless reloaded

On successful login, I’m embedding the user token in browser cookies and using router.push(‘/dashboard’) to take the user to his dashboard, but the ‘/dashboard’ page is not rendering any components unless I trigger a reload, on which all the components are rendered on the screen. Code block from /login page: Code block from /dashboard page: which on first returns a

Next.js router locale issue

I have set up some locales for our app which are uk and us. For the blog we can have either us/blog or just /blog for the uk locale. When I switch to us like so: (locale = “us”) the url gets correctly updated to have us/ prepended. When I switch back to uk using handleRoute (locale= “”), it stays

Advertisement