Javascript 使用react portal打开新窗口时,IE窗口变为空白

Javascript 使用react portal打开新窗口时,IE窗口变为空白,javascript,reactjs,portal,Javascript,Reactjs,Portal,以下是我尝试使用的代码: 如果还需要做什么,请告诉我。 该代码在chrome中运行良好。 我正在新窗口上创建一个splitview,其中左侧是图像,右侧是另一个组件 从“React”导入React; 从“react dom”导入react dom; 导出默认类NewWindow扩展React.Component{ 建造师(道具){ 超级(道具); 此.state={ win:null,containerEl:null }; } componentDidMount(){ 让win=窗口。打开(“

以下是我尝试使用的代码: 如果还需要做什么,请告诉我。 该代码在chrome中运行良好。 我正在新窗口上创建一个splitview,其中左侧是图像,右侧是另一个组件

从“React”导入React;
从“react dom”导入react dom;
导出默认类NewWindow扩展React.Component{
建造师(道具){
超级(道具);
此.state={
win:null,containerEl:null
};
}
componentDidMount(){
让win=窗口。打开(“”,,“宽度=600,高度=400”);
让containerell=win.document.createElement('div');
win.document.body.appendChild(containerere);
这个.copyStyles(containeerl、win.document);
this.setState({win,containerell});
}
copyStyles=(sourceDoc、targetDoc)=>{
from(sourceDoc.styleSheets).forEach(styleSheet=>{
if(styleSheet.cssRules){
const newStyleEl=sourceDoc.createElement('style');
from(styleSheet.cssRules).forEach(cssRule=>{
appendChild(sourceDoc.createTextNode(cssRule.cssText));
});
targetDoc.head.appendChild(newstylel);
}else if(styleSheet.href){
const newLinkEl=sourceDoc.createElement('link');
newLinkEl.rel='stylesheet';
newLinkEl.href=styleSheet.href;
targetDoc.head.appendChild(newLinkEl);
}
});
}
组件将卸载(){
this.state.win.close();
}
render(){
const{containerell}=this.state;
如果(!集装箱船){
返回null;
}
返回ReactDOM.createPortal(this.props.children,containerell);
}

}
如果您在createPortal()调用中替换了一些静态的东西,例如say来代替this.props.children,它是否具有相同的行为?谢谢,但不起作用!!!在IE中获取Script5022时引发异常但未捕获