Skip to content
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

Comment here incorrectly says shallow routing has been removed from Next.js #6590

Open
eatyourgreens opened this issue Dec 20, 2024 · 0 comments

Comments

@eatyourgreens
Copy link
Contributor

eatyourgreens commented Dec 20, 2024

Classifier component. Shallow routing isn't supported in Next.js 13, so the url-changing

Spotted while I was working on #6589. This comment says shallow routing isn't supported by Next.js. It's supported by the pages router in versions 13, 14, and 15. Documentation here:
https://nextjs.org/docs/pages/building-your-application/routing/linking-and-navigating#shallow-routing

In fact, I used it in #6216 to remember which workflow you are working on after going to Talk and back.

// client-side redirect if there's no workflow in the URL
if (!workflowID && defaultWorkflow) {
const newPath = router.asPath.replace('/classify', `/classify/workflow/${defaultWorkflow}`)
router.replace(newPath, newPath, { shallow: true })
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant