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

Warning If KeyboardedInput is unmounted and unfocused simultaneously #51

Open
etctschq opened this issue Jul 26, 2018 · 1 comment
Open

Comments

@etctschq
Copy link

I have run into a scenario where a user has used KeyboardedInput, and then clicks on a button in my UI that causes the KeyboardedInput component to be unmounted, but this also triggers the KeyboardInput's HandleFocusLost function.

This results in a warning like so:

warning.js:33 Warning: setState(...): Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component. This is a no-op. Please check the code for the KeyboardedInput component.

In my local testing I have removed the setTimeout() wrapper on this line, and I no longer receive the warning. Does this setTimeout() wrapper serve a purpose?

@reganlawton
Copy link
Collaborator

@etctschq I'll have to review the impact we looking at moving the deps to React v16 and doing a major release and releasing v1 now that we have alot more features and bugs squashed.

So it might be time also to review the logic of some of the setTimeout code too. It might need to clear timeout on componentWillUnmount.

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

No branches or pull requests

2 participants