Unverified Commit 44e9f0b2 authored by Jimmy Lai's avatar Jimmy Lai Committed by GitHub

app-router: add startTransition call to revalidate dispatcher (#49453)

This PR wraps the server patch dispatcher with a transition, we generally want all router dispatch to go through one

I'll follow up on tests properly later



link NEXT-1096
parent c93747eb
......@@ -186,18 +186,20 @@ function Router({
flightData: FlightData,
overrideCanonicalUrl: URL | undefined
) => {
dispatch({
type: ACTION_SERVER_PATCH,
flightData,
previousTree,
overrideCanonicalUrl,
cache: {
status: CacheStates.LAZY_INITIALIZED,
data: null,
subTreeData: null,
parallelRoutes: new Map(),
},
mutable: {},
React.startTransition(() => {
dispatch({
type: ACTION_SERVER_PATCH,
flightData,
previousTree,
overrideCanonicalUrl,
cache: {
status: CacheStates.LAZY_INITIALIZED,
data: null,
subTreeData: null,
parallelRoutes: new Map(),
},
mutable: {},
})
})
},
[dispatch]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment