mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-16 12:14:14 +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:
committed by
Ian Storm Taylor
parent
8d616b1f98
commit
990d37b694
@@ -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.
|
* Render the editor.
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user