react-touch-screen-keyboard icon indicating copy to clipboard operation
react-touch-screen-keyboard copied to clipboard

Warning If KeyboardedInput is unmounted and unfocused simultaneously

Open etctschq opened this issue 7 years ago • 1 comments

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?

etctschq avatar Jul 26 '18 20:07 etctschq

@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.

reganlawton avatar Jul 26 '18 22:07 reganlawton