No command found with name "focus"

Viewed 1924
2 Answers

I encountered a similar problem while using react native, with an accompanying version mismatch problem between js (0.62) and react native (0.63). The app I am developing also shows bad keyboard behavior for TextInput. Solved all problems by downgrade react native to 0.62.0, like so:

  • change the react native version # in package.json to 0.62.0
  • $ rm -rf node_modules yarn.lock
  • $ yarn install

So it's the version mismatch bug causing the keyboard focus issue in my case. Good luck!

Check if there isn't any code of yours trying to trigger focus on an element that doesn't support focus.

For example, in my case, I got this error when setting the autoFocus prop on an element different than TextInput, e.g. a Button or a View.

Related