1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-15 11:44:05 +02:00

Avoid async commands causing rerenders after unmount. (#2395)

* When the component unmounts, make sure async commands don't trigger react updates.

* Eslint fix
This commit is contained in:
Gersom van Ginkel
2018-11-07 20:34:15 +01:00
committed by Ian Storm Taylor
parent 8d616b1f98
commit 990d37b694

View File

@@ -122,6 +122,14 @@ class Editor extends React.Component {
}
}
/**
* When the component unmounts, make sure async commands don't trigger react updates.
*/
componentWillUnmount() {
this.tmp.mounted = false
}
/**
* Render the editor.
*