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>
Try this
import { Keyboard } from 'react-native';
Keyboard.dismiss()//Call where ever you needed
Docs here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With