Skip to content

Instantly share code, notes, and snippets.

@hanipcode
Created September 26, 2017 12:41
Show Gist options
  • Select an option

  • Save hanipcode/c14a67b904236f724491f2d1f8f244d7 to your computer and use it in GitHub Desktop.

Select an option

Save hanipcode/c14a67b904236f724491f2d1f8f244d7 to your computer and use it in GitHub Desktop.
Simplified AutoCompleteBox
// rest of code same as before..
const AutoCompleteBox = props => (
<View style={styles.AutoCompleteBox}>
<TextInput
{...props}
underlineColorAndroid="#FFF"
style={styles.AutoCompleteInput}
/>
<TouchableOpacity onPress={() => props.clearInput()}>
<Text style={styles.AutoCompleteClose}>X</Text>
</TouchableOpacity>
</View>
);
AutoCompleteBox.defaultProps = {
clearInput: () => console.log('Clear Input Pressed')
};
export default AutoCompleteBox;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment