File tree Expand file tree Collapse file tree 1 file changed +7
-12
lines changed
packages/solid-router/src Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -36,19 +36,14 @@ export function Transitioner() {
3636 const previousIsPagePending = usePrevious ( isPagePending )
3737
3838 router . startTransition = ( fn : ( ) => void | Promise < void > ) => {
39- // Execute fn synchronously to check if it returns a Promise
40- let result : void | Promise < void >
41- Solid . startTransition ( ( ) => {
42- result = fn ( )
43- } )
44-
45- // If fn returned a Promise, track the transition state
46- if ( result ! instanceof Promise ) {
47- setIsTransitioning ( true )
48- result . finally ( ( ) => {
39+ setIsTransitioning ( true )
40+ Solid . startTransition ( async ( ) => {
41+ try {
42+ await fn ( )
43+ } finally {
4944 setIsTransitioning ( false )
50- } )
51- }
45+ }
46+ } )
5247 }
5348
5449 // Subscribe to location changes
You can’t perform that action at this time.
0 commit comments