Bläddra i källkod

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

master
hristoterezov 8 år sedan
förälder
incheckning
d6c3ab64fa
1 ändrade filer med 4 tillägg och 0 borttagningar
  1. 4
    0
      react/features/always-on-top/index.js

+ 4
- 0
react/features/always-on-top/index.js Visa fil

@@ -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
+});

Laddar…
Avbryt
Spara