[Fizz] Two More Fixes (#21288)

* Emit value of option tags

* Mask the legacy context passed to classes
This commit is contained in:
Sebastian Markbåge
2021-04-15 10:26:49 -07:00
committed by GitHub
parent 11b07597ee
commit 9eddfbf5af
2 changed files with 8 additions and 7 deletions
@@ -729,15 +729,16 @@ function pushStartOption(
}
}
break;
case 'value':
value = propValue;
break;
case 'dangerouslySetInnerHTML':
invariant(
false,
'`dangerouslySetInnerHTML` does not work on <option>.',
);
// eslint-disable-next-line-no-fallthrough
case 'value':
value = propValue;
// We intentionally fallthrough to also set the attribute on the node.
// eslint-disable-next-line-no-fallthrough
default:
pushAttribute(target, responseState, propKey, propValue);
break;
+4 -4
View File
@@ -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);
}