I have a stack navigator where i have defined the searchScreen where i wish to get the input data and also have a SeachBar component which i attached in the stacknavigators headers as custom header.
My question is, how can i get the typed input data from search component to SearchScreen?
StackNavigator.js
<Stack.Screen
name="SearchScreen"
component={SearchScreen}
options={{ headerTitle: (props) => <SearchBar {...props} /> }}
/>
components/Searchbar.js
import { Searchbar } from "react-native-paper";
<Searchbar
placeholder="Search"
onChangeText={onChangeSearch}
value={searchQuery}
loading="true"
icon={() => <FontAwesome name="search" size={15} />}
style={{
backgroundColor: "white",
borderWidth: 0,
shadowColor: "transparent",
borderBottomColor: "transparent",
borderTopColor: "transparent",
}}
/>