Skip to content

Commit

Permalink
Stash the active context on the task
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sebmarkbage committed Jan 24, 2024
1 parent f3e8681 commit c289c7e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/react-server/src/ReactFlightServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ function renderElement(
}
case REACT_PROVIDER_TYPE: {
if (enableServerContext) {
pushProvider(type._context, props.value);
task.context = pushProvider(type._context, props.value);
if (__DEV__) {
const extraKeys = Object.keys(props).filter(value => {
if (value === 'children' || value === 'value') {
Expand Down Expand Up @@ -1199,7 +1199,7 @@ function renderModelDestructive(
}
return serializeByValueID(providerId);
} else if (value === POP) {
popProvider();
task.context = popProvider();
if (__DEV__) {
insideContextProps = null;
isInsideContextValue = false;
Expand Down

0 comments on commit c289c7e

Please sign in to comment.