tomcru / holy-loader

Holy Loader is a i18n-ready, lightweight, customizable top loading progress bar component for React / Next.js 13 & Next.js 14. #toploader #top-loader #nextjs-toploader #nprogress #nextjs-progressbar
https://www.npmjs.com/package/holy-loader
MIT License
108 stars 4 forks source link

Feature: Skip `replace` transitions #23

Open Honason opened 7 months ago

Honason commented 7 months ago

First of all, thank you for the well made library! I started using Holy loader in my app and it is triggered in situations when it's not appropriate given the UI context. In my case, I usually use router push transitions for navigation between pages, and replace for things like updating a query parameter that defines sorting, opening a modal window, and similar transitions that don't feel like navigation to the user, and are often instant.

For these reasons it would feel better to skip the loader in replace transitions. I'm thinking this could be a new feature, controlled by a boolean prop like skipReplaceTransitions. No breaking changes necessary as the default behaviour can stay the same.

Should I create a PR with this feature? What do you think about this approach in general?

iwasrobbed commented 3 months ago

Big plus one to this; would love a skipReplaceTransitions option otherwise it just gets noisy for when the page doesn't actually change beyond query params changing

Duplicates #17

tomcru commented 3 months ago

Sounds like a good idea and trivial to implement, PRs very welcome. It will likely take me some days to get to it otherwise. ✌️