Prevent memory leak when component updates and ref changes

This commit is contained in:
Dane Everitt 2019-09-17 22:40:59 -07:00
parent 75cd49a1c2
commit 12992e3521
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53

View file

@ -45,7 +45,7 @@ export default () => {
);
useEffect(() => {
if (ref.current) {
if (ref.current && !terminal.element) {
terminal.open(ref.current);
// @see https://github.com/xtermjs/xterm.js/issues/2265