Repository navigation
Commit 8100701
committed
fix(tanstack-router): defer mount work past selective-hydration event dispatch
Selective hydration flushes MatchesInner's layout effect in the capture
phase of the discrete event that revealed the deferred Suspense arm,
before the event reaches its handler. Calling mount() synchronously from
that effect lets commitLocation (URL canonicalization) race with the
click's own navigation.
Defer the stored mount work to a microtask so it runs after event
dispatch ends. The Link handler executes first and any in-flight
navigation prevents mount from starting a duplicate one.1 parent dfdeeac commit 8100701
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
61 | 65 | | |
62 | 66 | | |
63 | 67 | | |
64 | 68 | | |
65 | 69 | | |
66 | | - | |
| 70 | + | |
67 | 71 | | |
68 | 72 | | |
69 | 73 | | |
| |||
0 commit comments