天天看點

[React Native] Dismiss the Keyboard in React Native

in this lesson you will learn how create a re-usable component that gives the user the ability to dismiss the keyboard whenever they tap outside of a textinput. to accomplish this we'll take a look at the <code>touchablewithoutfeedback</code> component and the <code>keyboard</code> api.

the whole idea for dismiss keyboard is calling:

so build a high-order-component, which wraps the actually inputs element, when click happens outside the inputs, close the keyboard.