瀏覽代碼

fix(aot): Unmount AlwaysOnTop to remove listeners (#2307)

master
hristoterezov 8 年之前
父節點
當前提交
d6c3ab64fa
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4
    0
      react/features/always-on-top/index.js

+ 4
- 0
react/features/always-on-top/index.js 查看文件

@@ -8,3 +8,7 @@ ReactDOM.render(
8 8
     <AlwaysOnTop />,
9 9
     document.getElementById('react')
10 10
 );
11
+
12
+window.addEventListener('beforeunload', () => {
13
+    ReactDOM.unmountComponentAtNode(document.getElementById('react'));
14
+});

Loading…
取消
儲存