Skip to content

Replicating v8 useTransition behaviour without 'unique' prop #1027

Discussion options

You must be logged in to vote

Routing back to A while the transition is in motion will make a new A component transition

You can use location.key to prevent that.

Routing to A while A is already mounted will not transition in a new A component

This is more of a react-router issue: remix-run/react-router#5362

That thread has a workaround for blocking navigation to the current location, which I improved upon and added to your example. It works perfectly :)

https://codesandbox.io/s/react-spring-1027-tzx05

PS: You can help support my work on react-spring! Become my patron.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@lawrence-witt
Comment options

@aleclarson
Comment options

@lawrence-witt
Comment options

@aleclarson
Comment options

Answer selected by aleclarson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants