3

I have this simple screen

when I press in button the keyboard still apear How can I do this : " On a press of the button : Hide keyboard" ?

here is my code for button

 manage = () => { const { navigate } = this.props.navigation; if (this.state.text.length === 10) { navigate('service',{text: this.state.text}); } else { Alert.alert('الرجاء ادخال الرقم الوطني المكون من 10 أرقام') } } <Button title='التالي' backgroundColor="#C1272D" onPress={this.manage}> </Button> 

1 Answer 1

15

Try this

import { Keyboard } from 'react-native'; Keyboard.dismiss()//Call where ever you needed 

Docs here

Sign up to request clarification or add additional context in comments.

1 Comment

Works, very easy to use!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.