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

add targetPreprocessor parameter #37

Closed ShooTeX closed 7 months ago

ShooTeX commented 7 months ago

Suggestion to implement a URL preprocessor to handle modifications on the target URL before comparing to the current URL.

The reason for this PR is that we have anchors that don't have localized paths, the localization happens in our middleware so the current url is never the same as the target url, therefore the progressbar shows and never finishes.

Skyleen77 commented 7 months ago

I can't merge your PR directly because I made a lot of other modifications, but I included your changes in the new version 2.2.0.

Do not hesitate to give me feedback after testing it.