I am transferring React to React Native.
But I am sticked to the problem using e.target.value.
This is a code of React that works well.
_searchContact = (e) => { this.state.keyword
this.setState({
keyword : e.target.value
});
}
ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ
<input
name="keyword"
placeholder="Search"
value={this.state.keyword}
onChange={this._searchContact}
/>
And I tried to write again with the way of React-native
But it doesn't work.
_searchContact = (e) => {
this.setState({
keyword : e.nativeTarget.value
});
}
<TextInput
style={{height: 40, borderColor: 'gray', borderWidth: 1}}
name="keyword"
placeholder="Search"
onChangeText={this._searchContact}
value={this.state.keyword}
/>