Skip to content
Source
Sign inSign up
TanStack/router

fix(react-router): route-context being available and loaders being called after a redirection #1713

MergedSeanCassieremerged 48 commits intomain fromrefs/pull/1713/headmerged by SeanCassiere

Showing 5 changed files with 23 additions and 19 deletions (loading 3).

x
0 of 5 viewed, 5 left
1 addition and 1 deletionpackages/react-router/src/Transitioner.tsxModified
View file
@@ -29,7 +29,7 @@
​
// Subscribe to location changes
// and try to load the new location
- useLayoutEffect(() => {
+ React.useEffect(() => {
Thread on line 32

Did this since the cleanup function from useLayoutEffect kept running after a redirect was thrown without ever completing a repaint afterwards.

const unsub = router.history.subscribe(router.load)
​
const nextLocation = router.buildLocation({
22 additions and 18 deletionspackages/react-router/src/router.tsModified
View file
@@ -1548,7 +1548,7 @@
redirect = err
if (!this.isServer) {