Skip to content

Instantly share code, notes, and snippets.

@adamTrz
Created January 15, 2018 09:14
Show Gist options
  • Select an option

  • Save adamTrz/2b3db720f4fabb6b8d77d16d9f88f1c7 to your computer and use it in GitHub Desktop.

Select an option

Save adamTrz/2b3db720f4fabb6b8d77d16d9f88f1c7 to your computer and use it in GitHub Desktop.
react-native-ios-kit SearchBar example
/* @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