Skip to content
New issue

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

Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element' #84

Closed
mitchellwarr opened this issue Apr 1, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@mitchellwarr
Copy link

Every now and then the ArcherContainer fails to unobserve properly. This is happening maybe every third time I render my component

@pierpo pierpo added the bug Something isn't working label Apr 12, 2020
@pierpo
Copy link
Owner

pierpo commented Apr 12, 2020

Thank you for the issue. I'll have a look!
An example would be appreciated 😊

@mitchellwarr
Copy link
Author

Sorry I cant provide an example for you. Ive since shifted the code away from using this repo and as such have lost the code i used.

What I do know is the code I was using had a lost of useEffects and resizeObservers through it. It is likely do to asynchronous mounting and unmounting issues. Id suggest just making sure promise based code checks to make sure components are actually still mounted before it tries to unobserve. I would have made a pr with some if statements, but I didnt know what react-archer wants to do if the component isnt mounted

@pierpo
Copy link
Owner

pierpo commented Apr 13, 2020

Good point, there might be some issues there.
I'll try to reproduce the problem by myself then.

I have a quickfix in mind but I have no way to make sure that it solves the problem yet!

Thank you for the quick answer 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants