Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (current.isComponent && current.config.id === componentName) {
current.remove();
break;
}
if (current.contentItems) {
current.contentItems.forEach(x => items.push(x));
}
}
}
}
//Patching internal GoldenLayout.__lm.utils.ReactComponentHandler:
const ReactComponentHandler = GoldenLayout.__lm.utils.ReactComponentHandler;
class ReactComponentHandlerPatched extends ReactComponentHandler {
_render() {
// Instance of GoldenLayoutComponent class
const reactContainer = this._container.layoutManager.reactContainer;
if (reactContainer && reactContainer.componentRender) {
reactContainer.componentRender(this);
}
}
_destroy() {
this._container.off("open", this._render, this);
this._container.off("destroy", this._destroy, this);
}
this._container.off("destroy", this._destroy, this);
}
_getReactComponent() {
// The following method is absolute copy of the original, provided to prevent depenency on window.React
const defaultProps = {
glEventHub: this._container.layoutManager.eventHub,
glContainer: this._container
};
const props = $.extend(defaultProps, this._container._config.props);
return React.createElement(this._reactClass, props);
}
}
GoldenLayout.__lm.utils.ReactComponentHandler = ReactComponentHandlerPatched;