Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Skip replace transitions #23

Open
Honason opened this issue Mar 14, 2024 · 2 comments · May be fixed by #36
Open

Feature: Skip replace transitions #23

Honason opened this issue Mar 14, 2024 · 2 comments · May be fixed by #36

Comments

@Honason
Copy link

Honason commented Mar 14, 2024

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
Copy link

iwasrobbed commented Jun 28, 2024

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
Copy link
Owner

tomcru commented Jun 28, 2024

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

hootanht added a commit to hootanht/holy-loader that referenced this issue Nov 16, 2024
Fixes tomcru#23

Add `skipReplaceTransitions` prop to `HolyLoader` component to skip loader for `replaceState` transitions.

* **src/index.tsx**
  - Add `skipReplaceTransitions` prop to `HolyLoaderProps` interface.
  - Update `HolyLoader` component to handle `skipReplaceTransitions` prop.
  - Skip loader for `replaceState` transitions when `skipReplaceTransitions` is true.
* **README.md**
  - Add `skipReplaceTransitions` prop to the API section.
* **src/__tests__/holyLoader.test.ts**
  - Add tests to verify the behavior of `skipReplaceTransitions` prop.
@hootanht hootanht linked a pull request Nov 16, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants