Skip to content

Commit 29c557d

Browse files
committed
fix: wrap setState in transition
1 parent f8dfc80 commit 29c557d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

packages/router-core/src/router.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2288,10 +2288,14 @@ export class RouterCore<
22882288
: ''
22892289

22902290
if (matchesKey) {
2291-
this.__store.setState((s) => ({
2292-
...s,
2293-
[matchesKey]: s[matchesKey]?.map((d) => (d.id === id ? updater(d) : d)),
2294-
}))
2291+
this.startTransition(() => {
2292+
this.__store.setState((s) => ({
2293+
...s,
2294+
[matchesKey]: s[matchesKey]?.map((d) =>
2295+
d.id === id ? updater(d) : d,
2296+
),
2297+
}))
2298+
})
22952299
}
22962300
}
22972301

0 commit comments

Comments
 (0)