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,6 +186,7 @@ function Router({ ...@@ -186,6 +186,7 @@ function Router({
flightData: FlightData, flightData: FlightData,
overrideCanonicalUrl: URL | undefined overrideCanonicalUrl: URL | undefined
) => { ) => {
React.startTransition(() => {
dispatch({ dispatch({
type: ACTION_SERVER_PATCH, type: ACTION_SERVER_PATCH,
flightData, flightData,
...@@ -199,6 +200,7 @@ function Router({ ...@@ -199,6 +200,7 @@ function Router({
}, },
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