refactor: store more info about the transitions in the state#64
refactor: store more info about the transitions in the state#64
Conversation
d8f0324 to
e343e8e
Compare
e343e8e to
2ec8cbc
Compare
|
Hey, sorry I didn't see this earlier! I wish we had discussed it before you spent time on this direction, because I think it is not such a good idea to keep transition info in the navigation state. The only reason isTransitioning is in the state is because we need to notify the event system when a transition is happening. I really think the transition state should be handled by the navigator component, and not by navigation core. There are lots of edge cases that may crop up.. like, what if a navigator has a type of transition other than pushing or popping? I see the isTransitioning stuff has been removed from Tab Router, which would break the "didFocus/didBlur" events in an animated tab navigator. I actually think we should remove |
|
Thanks for checking. I think it's okay coz this change was not a lot of work and I needed it to continue with my work regarding stack, so I couldn't wait. I can easily change it when we arrive at an alternative API.
My use case is not for the event system. I'm rewriting stack navigator with reanimated: react-navigation/stack#131 The reasons I added this to router are:
The tab navigator never used the
I don't have any opinions about it, and it does seem better to remove this from the router. But the main issue is how can I access this info about which routes will animate from my component? I did take a look at the branch, but I think that's mostly related to the event system only. |
|
Closing as we agreed on an alternative way. |
I'm working on reimplementing stacks and storing this info in the routes state makes things much simpler and allows me to get rid of something like the transitioner.