Skyleen77 / next-nprogress-bar

NProgress integration on Next.js compatible with /app and /pages folders
https://next-nprogress-bar.vercel.app
315 stars 24 forks source link

router.replace() not triggering progress bar #29

Closed mamlzy closed 7 months ago

mamlzy commented 10 months ago

Hi thanks for this library, I think this library not implementing progress bar yet for the replace method? but push & back already implemented here. am i correct?

image
pingustar commented 9 months ago

yepp, came here to say the same

mamlzy commented 9 months ago

@Skyleen77

boreyko1 commented 9 months ago

meanwhile you can easily wrap it yourself with something like:

  const router = useNextRouter()

  const replace = React.useCallback(
    (
      href: string,
      options?: NavigateOptions | undefined,
      NProgressOptions?: NProgressOptions,
    ) => {
      if (NProgressOptions?.showProgressBar !== false) {
        NProgress.start()
      }

      return router.replace(href, options)
    },
    [router],
  )
Skyleen77 commented 7 months ago

This will be added in the next version which is coming soon.

mamlzy commented 7 months ago

This will be added in the next version which is coming soon.

glad to hear that! I think you could close the issue after the feature is added