I need help with passing the handleTextChange function in the SearchBarCustom component. When I try to remove onChangeText={setValue} and add onchange={handleTextChange}, I am unable to type anything in the search bar. How can I successfully pass in the handleTextChange function?
const SearchScreen = ({}: StackNavigationProps<Routes, "SearchScreen">) => {
const SearchBarCustom = (props) => {
const [value, setValue] = useState('');
return <SearchBar value={value} onChangeText={setValue} {...props} />;
};
return (
<ScrollView style={styles.container} contentInsetAdjustmentBehavior='automatic' stickyHeaderIndices={[0]}>
<View>
<GoogleAutoComplete apiKey={apiKey} debounce={500} minLength={1} queryTypes={'(cities)'} >
{({ handleTextChange, locationResults}) => (
<React.Fragment>
<View style={styles.inputWrapper}>
<SearchBarCustom
onChangeText={handleTextChange} // ???
containerStyle={{ backgroundColor: '#f3f2f8'}}
inputContainerStyle={{ backgroundColor: '#e3e3e9', height: 30}}
placeholderTextColor = '#96969b'
placeholder="Search"
platform="ios"
/>
</View>
<ScrollView>
{locationResults.map(el => (
<LocationItem
{ ...el}
key={el.id}
/>
))}
</ScrollView>
</React.Fragment>
)}
</GoogleAutoComplete>
</View>
</ScrollView>
);
};