Identify Return Key action in React Native

What I used is onSubmitEditing props. e.g.

<TextInput style={[styles.textInput]}
  placeholder="搜索"
  placeholderTextColor="#bbb"
  onChange={(event) => {
    this.searchChange(event.nativeEvent.text)
  }}
  returnKeyType="search"
  autoFocus={true}
  value={ this.props.searchName }
  selectionColor={colors.orangeColor}
  onSubmitEditing={this.searchSubmit}
  clearButtonMode="while-editing"
/>

Leave a Comment