blitz-js / blitz

⚡️ The Missing Fullstack Toolkit for Next.js
https://Blitzjs.com
MIT License
13.7k stars 798 forks source link

Resolved issue N.4362 #4364

Closed angeldevildev closed 3 months ago

angeldevildev commented 3 months ago

Closes: #4362

What are the changes and their implications?

All the useRouter are imported from next/navigation

Bug Checklist

Feature Checklist

changeset-bot[bot] commented 3 months ago

⚠️ No Changeset found

Latest commit: 882b21353368050836231729b6d50b21e78f59e7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

siddhsuresh commented 3 months ago

@angeldevildev thanks for the PR! I am not sure I understand, why these changes? (This will break all blitz apps 😅)

Understanding the imports:

  1. we import from "next/router" for the pages router apps,
  2. "next/compat/router" for deciding whether the app is in pages or app router. and
  3. "next/navigation" for app router apps.

You can read up on this in the next.js docs

https://nextjs.org/docs/app/api-reference/functions/use-router https://nextjs.org/docs/pages/api-reference/functions/use-router

Closing for now.