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
113 stars 7 forks source link

feat: exclude specific routes / disable loader #40

Open dev-aly3n opened 1 day ago

dev-aly3n commented 1 day ago

Description

Hi, As mentioned in the Next.js documentation, we can also modify the history stack using window.history.pushState or replaceState.

Imagine there is a gallery, and you want to change the page URL when the user swipes to the next artwork. This way, if they refresh the page, they will see that particular artwork again. Additionally, using searchParams is not an option for us in this scenario.

So, what if we could set a ref or state right before programmatically manipulating the history stack, and this prevents the loader from showing up at the top of the page?

Reproduction steps

.

Screenshots

![DESCRIPTION](LINK.png)

Logs

No response

Browsers

Chrome

OS

Mac

dev-aly3n commented 1 day ago

https://github.com/tomcru/holy-loader/issues/17#issuecomment-1965485574

dev-aly3n commented 1 day ago
<HolyLoader ignorePaths={[/^\/image-gallery\/*]} />