Skip to content

Commit

Permalink
This is probably wrong, but seemed worth a shot
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Jul 22, 2018
1 parent 8770737 commit 22142ab
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions packages/enzyme-adapter-react-16/src/ReactSixteenAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,21 @@ function toTree(vnode) {
switch (node.tag) {
case HostRoot: // 3
return childrenToTree(node.child);
case HostPortal: // 4
return childrenToTree(node.child);
case HostPortal: { // 4
let renderedNodes = flatten(nodeAndSiblingsArray(node.child).map(toTree));
if (renderedNodes.length === 0) {
renderedNodes = [node.memoizedProps.children];
}
return {
nodeType: 'portal',
type: node.type,
props: { ...node.memoizedProps },
key: ensureKeyOrUndefined(node.key),
ref: node.ref,
instance: null,
rendered: renderedNodes,
};
}
case ClassComponent:
return {
nodeType: 'class',
Expand Down

0 comments on commit 22142ab

Please sign in to comment.