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

Fix useEffect warning/memory leak #63

Merged
merged 6 commits into from
Oct 30, 2019

Conversation

adamyonk
Copy link
Contributor

Fixes the warning: Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.

Fixes the warning: `Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.`
@adamyonk
Copy link
Contributor Author

adamyonk commented Oct 29, 2019

This warning would happen if you ever unrendered Tool.tsx, e.g. if you navigated to a tab that doesn't have the Canvas toolbar rendered. A returned function from useEffect is essentially a cleanup callback.

@hipstersmoothie
Copy link
Owner

It looks like we can stop using our custom storybook API type since I think they now ship them

@adamyonk
Copy link
Contributor Author

I was just trying to get that tracked down. 😁 I'll get that fixed up.

@adamyonk
Copy link
Contributor Author

Screen Shot 2019-10-29 at 5 15 02 PM

@hipstersmoothie
Copy link
Owner

@adamyonk I think I figured it out. This should also fix another error I see on the console sometimes.

Thanks for the contribution!

@hipstersmoothie hipstersmoothie merged commit 4efb839 into hipstersmoothie:master Oct 30, 2019
@hipstersmoothie
Copy link
Owner

🚀 PR was released in v0.1.9 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants