What is the best way to have different transitions based on the app state?
See original GitHub issueSay that I have two pages PageA
and PageB
.
I want to transition between PageA
-> PageB
using TransitionX
.
But when I’m navigating between PageB
-> PageA
I want to use TransitionY
.
Is this easily achieved with this package or is it best to use a more custom solution? (React Spring or similar)
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:9 (7 by maintainers)
Top Results From Across the Web
Handling Common State Transitions - Apple Developer
Some of the most common transitions include launching the app, going to the background, and resuming. The app launches when it isn't running,...
Read more >Understand the states and transitions of an iOS App
It takes very little effort to monitor the transition messages and handle the various app states. A little due diligence goes a long...
Read more >Animation transitions - Unity - Manual
Drag the Duration “in” marker to change the duration of the transition and the Exit Time. Drag the target state to adjust the...
Read more >Activity state changes - Android Developers
Different events, some user-triggered and some system-triggered, can cause an Activity to transition from one state to another.
Read more >State Machine - Rive Guide
Connect your new states with Transitions. When you hover near a state, you'll see a dot appear. Click and drag on that dot...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I just found a solution for this. In my case I had pages that were dark themed and some that were light themed so I wanted use different transitions based on what page the user navigated to. I use pageProps for this. Here’s the simplified code:
Then in
_app.js
we can fetch thetheme
prop and pass it to thePageTransition
’s componentclassNames
prop.Now I can use the classes
transition-light-enter
transition-light-enter-active
transition-light-enter-done
transition-dark-enter
transition-dark-enter-active
transition-dark-enter-done
etc. etc. to style the different transitions.Sure thing. Called the example
multiple-transitions
to make it as general as possible.https://github.com/illinois/next-page-transitions/pull/39