DEV Community

loading...

Discussion on: Use NProgress with Next.js (Router and fetch events)

Collapse
vvo profile image
Vincent Voyer Author • Edited

Good question; I am experiencing the same as you because of using SWR. For now, I am fine with it, but you're right; there should be a way to disable it.

Ways to do this:

  • use a custom fetcher that calls window. fetch() with some specific (non-standard) params allowing you to identify the calls to fetch are from SWR
  • in your fetch monkey patch, find the URL path, and if it's "/api" then you could not show the progress

If you try one of those or find other ways, let me know!