i want to pass a parameter from Search.js to Stats.js The navigator is structured like this:
Search.js
const Search = () => {
<searchstack.Navigator>
<searchstack.Screen name="Search" component={SearchScreen}/>
</searchstack.Navigator>
}
const SearchScreen = () => {
//..
}
App.js - UPDATE WITH FULL CODE
import SearchFile from './Search';
import StatsFile from './Stats'
function HomeScreen() {
return (
<Tab.Navigator>
<Tab.Screen name="TabA" component={SearchFile} />
<Tab.Screen name="TabB" component={StatFila} />
</Tab.Navigator>
);
}
export default function App() {
return (
<NavigationContainer>
<Drawer.Navigator initialRouteName="Home">
<Drawer.Screen name="Home" component={HomeScreen}/>
<Drawer.Screen name="Profile" component={Profile} />
<Drawer.Screen name="Setting" component={Setting}/>
</Drawer.Navigator>
</NavigationContainer>
)
I update the APP.js with the full code, i can't understand how to pass a parameter from search to statsFile, so i have to pass a parameter from an inside StackNavigator to another StackNavigator, defined in the same TabNavigator. So, from SearchStack i have to go "up" to the Tab, move to the Stat, and then go "down" on the StatStack.