Skip to content

Commit

Permalink
Unwrap pure wrappers by creating an additional element as a single child
Browse files Browse the repository at this point in the history
This is very slow but meh. We're rewriting this whole thing anyway.
  • Loading branch information
sebmarkbage committed Oct 20, 2018
1 parent 1c07089 commit 28f5c3b
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions packages/react-dom/src/server/ReactPartialRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1004,18 +1004,12 @@ class ReactDOMServerRenderer {
}
case REACT_PURE_TYPE: {
const element: ReactElement = ((nextChild: any): ReactElement);
let nextChildren;
if (
typeof elementType.render === 'object' && elementType.render !== null && elementType.render.$$typeof === REACT_FORWARD_REF_TYPE
) {
nextChildren = toArray(
elementType.render.render(element.props, element.ref),
);
} else {
nextChildren = toArray(
elementType.render(element.props),
);
}
let nextChildren = [
React.createElement(
elementType.type,
Object.assign({ref: element.ref}, element.props),
),
];
const frame: Frame = {
type: null,
domNamespace: parentNamespace,
Expand Down

0 comments on commit 28f5c3b

Please sign in to comment.