We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用版本 1.1.4
hox使用 createModal 创建实例,但是没有销毁方法,在 modal 里使用副作用例如监听dom元素没有办法在最后销毁。
强烈建议增加一个销毁方法 destroy 以便手动触发 unmount
参考react-dom的销毁方法,
https://github.com/facebook/react/blob/784a725fe139b88c37f8b16d1d2225e88caf2612/packages/react-dom/src/client/ReactDOMLegacy.js#L361
https://github.com/facebook/react/blob/784a725fe139b88c37f8b16d1d2225e88caf2612/packages/react-dom/src/client/ReactDOMLegacy.js#L189
只需要在调用destroy方法时将 hox 内部的react root 清空,就可以卸载掉数据组件,触发unmount
// 第一个参数设置为null表示清空子组件 reconciler.updateContainer(null, container, null, null);
The text was updated successfully, but these errors were encountered:
awmleer
No branches or pull requests
使用版本 1.1.4
hox使用 createModal 创建实例,但是没有销毁方法,在 modal 里使用副作用例如监听dom元素没有办法在最后销毁。
强烈建议增加一个销毁方法 destroy 以便手动触发 unmount
参考react-dom的销毁方法,
https://github.com/facebook/react/blob/784a725fe139b88c37f8b16d1d2225e88caf2612/packages/react-dom/src/client/ReactDOMLegacy.js#L361
https://github.com/facebook/react/blob/784a725fe139b88c37f8b16d1d2225e88caf2612/packages/react-dom/src/client/ReactDOMLegacy.js#L189
只需要在调用destroy方法时将 hox 内部的react root 清空,就可以卸载掉数据组件,触发unmount
The text was updated successfully, but these errors were encountered: