Suppose I have this custom component:
export default class Button extends Component { render(){ return( <TouchOpacity> <Text> Button </Text> </TouchOpacity> ) } }
And I use it in the parent component, for example:
export default class MainPage extends Component { render(){ return( <Button onPress={ this.doSomething }></Button> ) } }
For some reason (at least I donโt know) this onPress will not even happen. I'm pretty new to reacting to battle. I believe I should find a way to enable this event handling.
Is it possible to get a small example of how to achieve this, based on my examples above?
source share