/* @flow */ import * as React from 'react'; import { StyleSheet, View } from 'react-native'; import { Colors, Caption, SearchBar, withTheme } from 'react-native-paper'; import type { Theme } from 'react-native-paper/types'; type Props = { navigation: any, theme: Theme, }; type State = { firstQuery: string, secondQuery: string, thirdQuery: string, }; class SearchExample extends React.Component { static title = 'Search bar'; state = { firstQuery: '', secondQuery: '', thirdQuery: '', }; render() { const { theme: { colors: { background } } } = this.props; return ( this.setState({ firstQuery: query })} value={this.state.firstQuery} /> Clickable icon this.setState({ secondQuery: query })} value={this.state.secondQuery} onIconPress={() => this.props.navigation.goBack()} icon="arrow-back" /> this.setState({ thirdQuery: query })} value={this.state.thirdQuery} onIconPress={/* In real code, this will open the drawer */ () => {}} icon="menu" /> ); } } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: Colors.grey200, }, caption: { paddingHorizontal: 16, paddingVertical: 8, }, }); export default withTheme(SearchExample);