Properly destroy Vue components after they’re unmounted by React
This commit is contained in:
parent
231afa8ed6
commit
4654025423
|
@ -59,6 +59,11 @@ export default class {
|
||||||
this.vueInstance.$mount(this.vueMount);
|
this.vueInstance.$mount(this.vueMount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentWillUnmount() {
|
||||||
|
this.vueInstance.$destroy();
|
||||||
|
delete this._vueInstance;
|
||||||
|
}
|
||||||
|
|
||||||
get vueMount() {
|
get vueMount() {
|
||||||
const element = ReactDOM.findDOMNode(this);
|
const element = ReactDOM.findDOMNode(this);
|
||||||
if (!element) return;
|
if (!element) return;
|
||||||
|
|
Loading…
Reference in New Issue