onpress this.setstate code example Example: onpress setstate react native onPress={() => this.setState({switch: false})}