File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
packages/react-router/src Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ export function Transitioner() {
1111 select : ( { isLoading } ) => isLoading ,
1212 } )
1313
14- const [ isTransitioning , startReactTransition_ ] = React . useTransition ( )
14+ const [ isTransitioning , setIsTransitioning ] = React . useState ( false )
1515 // Track pending state changes
1616 const hasPendingMatches = useRouterState ( {
1717 select : ( s ) => s . matches . some ( ( d ) => d . status === 'pending' ) ,
@@ -27,7 +27,13 @@ export function Transitioner() {
2727 const previousIsPagePending = usePrevious ( isPagePending )
2828
2929 if ( ! router . isServer ) {
30- router . startReactTransition = startReactTransition_
30+ router . startReactTransition = ( fn : ( ) => void ) => {
31+ setIsTransitioning ( true )
32+ React . startTransition ( ( ) => {
33+ fn ( )
34+ setIsTransitioning ( false )
35+ } )
36+ }
3137 }
3238
3339 // Subscribe to location changes
You can’t perform that action at this time.
0 commit comments