Skip to content

Commit 84e7a05

Browse files
committed
refactor(solid-router): remove unnecessary setTimeout from Match components
1 parent 5127d86 commit 84e7a05

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

.changeset/proud-clubs-buy.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tanstack/solid-router': patch
3+
---
4+
5+
Remove unnecessary setTimeout from Match components

packages/solid-router/src/Match.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ export const MatchInner = (): any => {
354354
}
355355

356356
const [loaderResult] = Solid.createResource(async () => {
357-
await new Promise((r) => setTimeout(r, 0))
357+
await Promise.resolve()
358358
return router.getMatch(currentMatch().id)?._nonReactive
359359
.loadPromise
360360
})
@@ -411,7 +411,7 @@ export const MatchInner = (): any => {
411411
}
412412

413413
const [loaderResult] = Solid.createResource(async () => {
414-
await new Promise((r) => setTimeout(r, 0))
414+
await Promise.resolve()
415415
return getLoadPromise(matchId, routerMatch)
416416
})
417417

0 commit comments

Comments
 (0)