You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
useRouter is availabe from multiple libs. Is there one true source? Or how should we decide among them?
import {useRouter} from "next/compat/router"
import {useRouter} from "next/navigation"
import {useRouter} from "next/compat/router"
These all appear in the https://github.com/blitz-js/blitz repo, and in a new project I generated using blitz new.
Just looking for a pattern, it appears that 100% of the time when router.refresh() is used, the next/navigation source is being used. The opposite isn't true -- sometimes next/navigation is used when there's no router.refresh() happening.
Should we only be using one of these? If yes, should the others be removed? If no, how do we know when to use when?
What is the problem?
useRouter
is availabe from multiple libs. Is there one true source? Or how should we decide among them?import {useRouter} from "next/compat/router"
import {useRouter} from "next/navigation"
import {useRouter} from "next/compat/router"
These all appear in the
https://github.com/blitz-js/blitz
repo, and in a new project I generated usingblitz new
.Just looking for a pattern, it appears that 100% of the time when
router.refresh()
is used, thenext/navigation
source is being used. The opposite isn't true -- sometimesnext/navigation
is used when there's norouter.refresh()
happening.Should we only be using one of these? If yes, should the others be removed? If no, how do we know when to use when?
Paste all your error logs here:
N/A
Paste all relevant code snippets here:
N/A
What are detailed steps to reproduce this?
N/A
Run
blitz -v
and paste the output here:Please include below any other applicable logs and screenshots that show your problem:
No response
The text was updated successfully, but these errors were encountered: