Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add events with NativeBase components

What events are available for the NativeBase components?

Say for example,

  • Update the state on the input on onChangeText
  • I would like to respond to Button clicks while submitting a form

What other events those mentioned in React Native are supported with the NativeBase components?

like image 810
Vishal Swaroop Avatar asked Aug 05 '16 13:08

Vishal Swaroop


2 Answers

This should be as simple as using the onPress method props on the button component:

<Button style={{ backgroundColor: 'grey'}} onPress={() =>alert('Add payment')} block >
<Icon name="ios-add-circle-outline" />
ADD PAYMENT
</Button>
like image 53
Shivam Sinha Avatar answered Sep 28 '22 01:09

Shivam Sinha


All the props which are supported by touchable opacity in react native are supported by button component. button component justs adds some extra props along with touchable opacity.

like image 43
akshay Avatar answered Sep 28 '22 01:09

akshay