prevent menu icon replace back button react native code example
Example 1: how to add button in alert box in react native
Alert.alert(
'Alert Title',
'My Alert Msg',
[
{text: 'Ask me later', onPress: () => console.log('Ask me later pressed')},
{
text: 'Cancel',
onPress: () => console.log('Cancel Pressed'),
style: 'cancel',
},
{text: 'OK', onPress: () => console.log('OK Pressed')},
],
{cancelable: false},
);
Example 2: remove back button text nav bar swift
navigationItem.backBarButtonItem = UIBarButtonItem(title: "", style: .plain, target: nil, action: nil)
Example 3: show back button in navbar swift
let backButton = UIBarButtonItem()
backButton.title = "New Back Button Text"
self.navigationController?.navigationBar.topItem?.backBarButtonItem = backButton
Example 4: disable a button react
<input onChange={e => this.setState({ value: e.target.value })} value={this.state.value} />
<button disabled={!this.state.value} />