Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const element: JSX.Element | null = this.props.children({
...this.renderParams,
});
const { children, ...props } = getElementProps(element);
if (this.rootPropsConfig.called) {
// Simply return the element as this method can never actually be called
// within a domless environment
return element;
} else if (
// When called by a provider `getRootProps` can't actually be called until
// the jsx is generated. Check if this is being rendered via any remirror
// context provider. In this case `getRootProps` **must** be called by the
// consumer.
isRemirrorContextProvider(element) ||
isRemirrorProvider(element) ||
isManagedRemirrorProvider(element)
) {
const { childAsRoot } = element.props;
return childAsRoot
? cloneElement(element, props, this.renderClonedElement(children, childAsRoot))
: element;
} else {
return isReactDOMElement(element) ? (
this.renderClonedElement(element)
) : (
<div>
);
}
}
</div>