File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -710,7 +710,7 @@ export type CommitLocationFn = ({
710710 ...next
711711} : ParsedLocation & CommitLocationOptions ) => Promise < void >
712712
713- export type StartTransitionFn = ( fn : ( ) => void ) => void
713+ export type StartTransitionFn = ( fn : ( ) => void | Promise < void > ) => void
714714
715715export interface MatchRoutesFn {
716716 (
Original file line number Diff line number Diff line change @@ -37,13 +37,14 @@ export function Transitioner() {
3737
3838 router . startTransition = ( fn : ( ) => void | Promise < void > ) => {
3939 setIsTransitioning ( true )
40- Solid . startTransition ( async ( ) => {
41- try {
42- await fn ( )
43- } finally {
40+ const result = fn ( )
41+ if ( result instanceof Promise ) {
42+ result . finally ( ( ) => {
4443 setIsTransitioning ( false )
45- }
46- } )
44+ } )
45+ } else {
46+ setIsTransitioning ( false )
47+ }
4748 }
4849
4950 // Subscribe to location changes
You can’t perform that action at this time.
0 commit comments