Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function elementToTree(el) {
if (!isPortal(el)) {
return utilElementToTree(el, elementToTree);
}
const { children, containerInfo } = el;
const props = { children, containerInfo };
return {
nodeType: 'portal',
type: Portal,
props,
key: ensureKeyOrUndefined(el.key),
ref: el.ref || null,
instance: null,
rendered: elementToTree(el.children),
};
}
function elementToTree(el) {
if (!isPortal(el)) {
return utilElementToTree(el, elementToTree);
}
const { children, containerInfo } = el;
const props = { children, containerInfo };
return {
nodeType: 'portal',
type: Portal,
props,
key: ensureKeyOrUndefined(el.key),
ref: el.ref || null,
instance: null,
rendered: elementToTree(el.children),
};
}
function elementToTree(el) {
if (!isPortal(el)) {
return utilElementToTree(el, elementToTree);
}
const { children, containerInfo } = el;
const props = { children, containerInfo };
return {
nodeType: 'portal',
type: Portal,
props,
key: ensureKeyOrUndefined(el.key),
ref: el.ref || null,
instance: null,
rendered: elementToTree(el.children),
};
}
function elementToTree(el) {
if (!isPortal(el)) {
return utilElementToTree(el, elementToTree);
}
const { children, containerInfo } = el;
const props = { children, containerInfo };
return {
nodeType: 'portal',
type: Portal,
props,
key: ensureKeyOrUndefined(el.key),
ref: el.ref || null,
instance: null,
rendered: elementToTree(el.children),
};
}