I have a TextInput component that calls an 'OnChangeText' event :
<TextInput onChangeText={(text) => this.setState({zip:text})}/>
That works fine.
Now I want to change the call event to a function:
<TextInput onChangeText={_handleTextChange}/>
_handleTextChange(event) {
this.setState({zip:
event.nativeEvent.text});
}
That doesn't work. I get the following error :
undefined is not an object (evaluating 'event.nativeEvent.text'
How do send the 'Event' object to _handleTextChange function?
Thanks, Yaron