I am doing react native project. In that, I have to show custom image like toggle button, In that, for OFF one image and ON another image I have to display, And in that, two components should have to display according to ON/OFF states.
I am new to this domain.
I have knowledge to set image touchable/Onpress, but, How to set custom image and act like toggle according to that components switch.
this.toggleAction() = () => {
//switching components for ON/OFF states
}
<TouchableHighlight >
<Image style={styles.imagestyle}
source={require('./ic_toggle_on.png')} />
onPress={() => this.toggleAction()}>
</TouchableHighlight>
Any suggestions?