Skip to content

Commit c289c7e

Browse files
committed
Stash the active context on the task
This doesn't come into play in Flight because the provider is not destructive so you can't suspend in the current task within a new context. The feature is also deprecated anyway. This is just for parity.
1 parent f3e8681 commit c289c7e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/react-server/src/ReactFlightServer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ function renderElement(
614614
}
615615
case REACT_PROVIDER_TYPE: {
616616
if (enableServerContext) {
617-
pushProvider(type._context, props.value);
617+
task.context = pushProvider(type._context, props.value);
618618
if (__DEV__) {
619619
const extraKeys = Object.keys(props).filter(value => {
620620
if (value === 'children' || value === 'value') {
@@ -1199,7 +1199,7 @@ function renderModelDestructive(
11991199
}
12001200
return serializeByValueID(providerId);
12011201
} else if (value === POP) {
1202-
popProvider();
1202+
task.context = popProvider();
12031203
if (__DEV__) {
12041204
insideContextProps = null;
12051205
isInsideContextValue = false;

0 commit comments

Comments
 (0)