Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
renderEditor(children) {
if (!children) {
return null;
}
if (Children.count(children) !== 1) {
return null;
}
// const child = Rax.Children.only(children)
// if (child.type === PolyEditor) {
// return React.cloneElement(child, {
// __poly__: this.polyline,
// __map__: this.map
// })
// }
return null;
}
renderEditor(children) {
if (!children) {
return null;
}
if (Children.count(children) !== 1) {
return null;
}
// const child = React.Children.only(children)
// if (child.type === PolyEditor) {
// return React.cloneElement(child, {
// __poly__: this.polygon,
// __map__: this.map
// })
// }
return null;
}
renderEditor(children) {
if (!children) {
return null;
}
if (Children.count(children) !== 1) {
return null;
}
return cloneElement(Children.only(children), {
__circle__: this.mapCircle,
__map__: this.map,
__ele__: this.element
});
}
expanded,
onClick,
children,
nodeRenderer,
title,
shouldShowArrow,
shouldShowPlaceholder,
} = this.props;
const renderedNode = createElement(nodeRenderer, this.props);
const childNodes = expanded ? children : undefined;
return (
<div title="{title}" style="{styles.treeNodeBase}" role="treeitem" aria-expanded="{expanded}">
<div style="{styles.treeNodePreviewContainer}">
{shouldShowArrow || Children.count(children) > 0
?
: shouldShowPlaceholder && <span style="{styles.treeNodePlaceholder}"> </span>}
{renderedNode}
</div>
<ol style="{styles.treeNodeChildNodesContainer}" role="group">
{childNodes}
</ol>
</div>
);
}
}