[flow] isTextInputElement (#7075)
[flow] isTextInputElement (#7075)

Summary:

I had to cast into any because flow doesn't think that checking the lowercase version of nodeName is a valid way to refine the variable from HTMLElement to HTMLInputElement. I'm also not confident enough in changing the implementation to an instanceof HTMLInputElement to please flow. It also takes care of the null check in the process.

The `nodeName &&` condition wasn't useful since the two branches are checking it against concrete values and actually makes the type different since nodeName is not a boolean per se. I replaced them with if conditions to make it clearer what it actually did instead of doing boolean logic tricks.

It is unclear why I had to type supportedInputTypes, see this internal post for a discussion: https://www.facebook.com/groups/flowtype/permalink/1084168611631753/

The only difference in behavior is that I now explicitely convert to boolean the object dereference via `!!`.

Test Plan:
npm run flow
Careful inspection of the code

Reviewers: 663c8c2f2861ffa32b57d2756c3a277500005cdc@spicyj
(cherry picked from commit 309215fc40e81354bd06d11e108866f87156fb55)

with-git/react,with-git/react,with-git/react,with-git/react,with-git/react,with-git/react,with-git/react