Просмотр исходного кода

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

j8
hristoterezov 8 лет назад
Родитель
Сommit
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
+});

Загрузка…
Отмена
Сохранить