Closed ZvozdaB closed 1 year ago
Could you post more code so I can see what's going on?
I do not know how to solve this problem in v17 React, but in v18 it solved by calling root.unmount()
on React root while destroying AngularJS component/directive.
Please see:
.unmount()
https://github.com/ornic/react18-in-angularjs-useeffect/commit/d4684f402cfb0b63b9d49cec2ebe35c61763a618@ornic thanks for your idea, here is a request on how to solve it for react 17.
@xjpro can you merge it? This request will solve the problem of the accumulation of React components in the virtual DOM. This can be seen in the react-dev-tools tab components when going and returning to the page. Will also allow you to use useEffect clean-up function
useEffect(() => { return () => { ...some code runs when component unmount } }, [])
@xjpro almost all forks are used to raise the version of React to 18. Maybe it makes sense to make a major release by raising the version of React? and can use @ornic forks
I try to use useEffect clean-up function or componentWillUnmount in angularize component but it not work. Work only in child component when angularize component exist and child component destroy. But if destroy angularize component clean-up function not work in angularize component or child component.
Сould you help? Thank you