Open ahmedriad1 opened 3 days ago
When using a localization library, in this case next-intl, you have to use their router so that they can handle locales when changing the url.
next-intl
Example:
import { createSharedPathnamesNavigation } from "next-intl/navigation"; const navigation = createSharedPathnamesNavigation({ locales: PATH_LOCALES }); // localized router navigation.useRouter
This means there is currently no way to use next-nprogress-bar's router.
next-nprogress-bar
Provide a function that accepts a useRouter hook, and returns a modified version of it that supports nprogress as well.
useRouter
import { makeNprogressRouter } from 'next-nprogress-bar'; import { createSharedPathnamesNavigation } from "next-intl/navigation"; const navigation = createSharedPathnamesNavigation({ locales: PATH_LOCALES }); export const useRouter = makeNprogressRouter(navigation.useRouter);
When using a localization library, in this case
next-intl
, you have to use their router so that they can handle locales when changing the url.Example:
This means there is currently no way to use
next-nprogress-bar
's router.Ask
Provide a function that accepts a
useRouter
hook, and returns a modified version of it that supports nprogress as well.Example: