Created
January 15, 2018 09:14
-
-
Save adamTrz/2b3db720f4fabb6b8d77d16d9f88f1c7 to your computer and use it in GitHub Desktop.
react-native-ios-kit SearchBar example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* @flow */ | |
| import React, { Component } from 'react'; | |
| import { View, StyleSheet } from 'react-native'; | |
| import { withTheme, SearchBar } from 'react-native-ios-kit'; | |
| import type { Theme } from 'react-native-ios-kit/types'; | |
| type Props = { | |
| theme: Theme, | |
| }; | |
| type State = { | |
| text: string, | |
| }; | |
| class SearchBarExample extends Component<Props, State> { | |
| state = { | |
| text: '', | |
| }; | |
| render() { | |
| return ( | |
| <View style={styles.screen}> | |
| <SearchBar | |
| value={this.state.text} | |
| onValueChange={text => this.setState({ text })} | |
| withCancel | |
| animated | |
| /> | |
| </View> | |
| ); | |
| } | |
| } | |
| export default withTheme(SearchBarExample); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment