Skip to content

Commit

Permalink
[Fizz] Two More Fixes (#21288)
Browse files Browse the repository at this point in the history
* Emit value of option tags

* Mask the legacy context passed to classes
  • Loading branch information
sebmarkbage authored Apr 15, 2021
1 parent 11b0759 commit 9eddfbf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions packages/react-dom/src/server/ReactDOMServerFormatConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
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 9eddfbf

Please sign in to comment.