11import React from 'react' ;
2- import { NativeModules , StyleSheet , TextInput , View } from 'react-native' ;
3- import { withNavigation } from 'react-navigation' ;
4- import Touchable from 'react-native-platform-touchable' ;
2+ import { NativeModules , StyleSheet , TextInput , TouchableNativeFeedback , View } from 'react-native' ;
53import Ionicons from 'react-native-vector-icons/Ionicons' ;
4+ import { useNavigation } from '@react-navigation/native' ;
65
7- @withNavigation
8- export default class SearchBar extends React . PureComponent {
6+ class SearchBar extends React . PureComponent {
97 componentDidMount ( ) {
108 requestAnimationFrame ( ( ) => {
119 this . _textInput . focus ( ) ;
@@ -42,17 +40,17 @@ export default class SearchBar extends React.PureComponent {
4240 < View
4341 style = { { width : 50 , alignItems : 'center' , justifyContent : 'center' } } >
4442 { this . state . text
45- ? < Touchable
43+ ? < TouchableNativeFeedback
4644 onPress = { this . _handleClear }
4745 hitSlop = { { top : 15 , left : 10 , right : 15 , bottom : 15 } }
4846 style = { { padding : 5 } }
49- background = { Touchable . Ripple ( this . props . tintColor , true ) } >
47+ background = { TouchableNativeFeedback . Ripple ( this . props . tintColor , true ) } >
5048 < Ionicons
5149 name = "md-close"
5250 size = { 25 }
5351 color = { this . props . tintColor }
5452 />
55- </ Touchable >
53+ </ TouchableNativeFeedback >
5654 : null }
5755 </ View >
5856 </ View >
@@ -74,6 +72,14 @@ export default class SearchBar extends React.PureComponent {
7472 } ;
7573}
7674
75+ export default function ( props ) {
76+ const navigation = useNavigation ( ) ;
77+
78+ return (
79+ < SearchBar { ...props } navigation = { navigation } />
80+ ) ;
81+ }
82+
7783const styles = StyleSheet . create ( {
7884 container : {
7985 flex : 1 ,
0 commit comments