Skip to content

Commit 0847015

Browse files
committed
Revert "working scroll restoration"
This reverts commit fa5a90b.
1 parent fa5a90b commit 0847015

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

packages/solid-router/src/Transitioner.tsx

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)