react native disable button code example

Example 1: disable yellow box react native

console.disableYellowBox = true;

Example 2: react native touchableopacity disable

<TouchableOpacity disabled={true}>
  <Text>I'm disabled</Text>
</TouchableOpacity>

Example 3: disable a button react

// Input field listens to change, updates React's state and re-renders the component.
<input onChange={e => this.setState({ value: e.target.value })} value={this.state.value} />

// Button is disabled when input state is empty.
<button disabled={!this.state.value} />