view onpress react native

Solutions on MaxInterview for view onpress react native by the best coders in the world

showing results for - "view onpress react native"
Bilel
29 Feb 2017
1// View does not support on press event, instead, use touchable components
2// that support this prop
3// Example:
4<TouchableOpacity onPress={onPressFunction}>
5	<>
6		// Elements with onpress event
7	</>
8</TouchableOpacity>
Irene
13 Jul 2019
1<TouchableOpacity style={{backgroundColor: "red", padding: 20}} onPress={()=> {
2    console.log('does not work');
3    }
4  }>
5  <Text>X</Text>
6</TouchableOpacity>
7