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({ ...@@ -186,18 +186,20 @@ function Router({
flightData: FlightData, flightData: FlightData,
overrideCanonicalUrl: URL | undefined overrideCanonicalUrl: URL | undefined
) => { ) => {
dispatch({ React.startTransition(() => {
type: ACTION_SERVER_PATCH, dispatch({
flightData, type: ACTION_SERVER_PATCH,
previousTree, flightData,
overrideCanonicalUrl, previousTree,
cache: { overrideCanonicalUrl,
status: CacheStates.LAZY_INITIALIZED, cache: {
data: null, status: CacheStates.LAZY_INITIALIZED,
subTreeData: null, data: null,
parallelRoutes: new Map(), subTreeData: null,
}, parallelRoutes: new Map(),
mutable: {}, },
mutable: {},
})
}) })
}, },
[dispatch] [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