Skip to content

Commit 9eddfbf

Browse files
authored
[Fizz] Two More Fixes (#21288)
* Emit value of option tags * Mask the legacy context passed to classes
1 parent 11b0759 commit 9eddfbf

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

packages/react-dom/src/server/ReactDOMServerFormatConfig.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -729,15 +729,16 @@ function pushStartOption(
729729
}
730730
}
731731
break;
732-
case 'value':
733-
value = propValue;
734-
break;
735732
case 'dangerouslySetInnerHTML':
736733
invariant(
737734
false,
738735
'`dangerouslySetInnerHTML` does not work on <option>.',
739736
);
740737
// eslint-disable-next-line-no-fallthrough
738+
case 'value':
739+
value = propValue;
740+
// We intentionally fallthrough to also set the attribute on the node.
741+
// eslint-disable-next-line-no-fallthrough
741742
default:
742743
pushAttribute(target, responseState, propKey, propValue);
743744
break;

packages/react-server/src/ReactFizzServer.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -563,11 +563,11 @@ function renderClassComponent(
563563
Component: any,
564564
props: any,
565565
): void {
566-
const unmaskedContext = !disableLegacyContext
567-
? task.legacyContext
566+
const maskedContext = !disableLegacyContext
567+
? getMaskedContext(Component, task.legacyContext)
568568
: undefined;
569-
const instance = constructClassInstance(Component, props, unmaskedContext);
570-
mountClassInstance(instance, Component, props, unmaskedContext);
569+
const instance = constructClassInstance(Component, props, maskedContext);
570+
mountClassInstance(instance, Component, props, maskedContext);
571571
finishClassComponent(request, task, instance, Component, props);
572572
}
573573

0 commit comments

Comments
 (0)