Skip to content

Instantly share code, notes, and snippets.

@kendhia
Created April 27, 2020 08:16
Show Gist options
  • Save kendhia/710aca30fa94a650642b44d80a89aef6 to your computer and use it in GitHub Desktop.
Save kendhia/710aca30fa94a650642b44d80a89aef6 to your computer and use it in GitHub Desktop.
//[RENDER]
<TextInput
autoFocus={true}
onChangeText={value => this.changeKeyword(value)}
onSubmitEditing={event => {
this.changeKeyword(event.nativeEvent.text);
}}
style={{
padding: 0,
margin: 0,
paddingLeft: width * 0.02,
flex: 8,
fontSize: height * 0.022,
color: '#6F6F6F',
}}
placeholder="Search..."
/>
#[FUNCTION]
changeKeyword = value => {
if (value.length < 3) return;
this.setState({refreshing: true});
this.searchForKeyword(value);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment