Skip to content

Commit

Permalink
Mask the legacy context passed to classes
Browse files Browse the repository at this point in the history
  • Loading branch information
sebmarkbage committed Apr 15, 2021
1 parent ef3011c commit fe13487
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/react-server/src/ReactFizzServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -563,11 +563,11 @@ function renderClassComponent(
Component: any,
props: any,
): void {
const unmaskedContext = !disableLegacyContext
? task.legacyContext
const maskedContext = !disableLegacyContext
? getMaskedContext(Component, task.legacyContext)
: undefined;
const instance = constructClassInstance(Component, props, unmaskedContext);
mountClassInstance(instance, Component, props, unmaskedContext);
const instance = constructClassInstance(Component, props, maskedContext);
mountClassInstance(instance, Component, props, maskedContext);
finishClassComponent(request, task, instance, Component, props);
}

Expand Down

0 comments on commit fe13487

Please sign in to comment.