Category : react-navigation

i’m developing an app for tuning pianos in react-native. I have an App.js and some screens implemented with react-navigation. The question is, how i can call a function in App.js from other Screen component in react-native? I’m missing something of react-native, i searched on web but i can’t find something really useful. The App.js code: ..

Read more

I am practicing moving from class components to functional components in react native and I am having trouble understanding how to access navigation from a component. Normally I would run something like this.props.navigation.navigate(‘screen’). Now I am normally passing navigation as a prop. But it doesn’t seem to work in the following example. Where am I ..

Read more

I would like to add a button in the topBar that does popToTop only in two screens of the navigation stack. I tried to do this, but apparently the navigation does not work. My code is as follow: const Stack = createStackNavigator(); export default function App({navigation}) { return ( <NavigationContainer> <Stack.Navigator> <Stack.Screen name=’MyMusic’ component={TabNavigator} /> ..

Read more

I am using react-navigation & I have encountered a use case where I need to navigate from outside a component (navigation after receiving push notification). The issue is, when using the navigation.navigate method from inside a component, I get proper Typescript Autocomplete and Intellisense based on all the types defined as per the documentation. However, ..

Read more

I have a complex array filled the objects .(Shown below) const privateMessages = Array [ Object { "_id": "607533d511a2301b204720ed", "chat": Array [ Object { "_id": "6098ffd30a2f4287f92be018", "createdAt": "2021-05-10T09:41:39.683Z", "text": "G", "user": Object { "_id": "60716a38136f970ba4a0526e", }, }, Object { "_id": "6097b6e69f98cbf5ba6deaf8", "createdAt": "2021-05-09T10:18:36.972Z", "text": "ржд", "user": Object { "_id": "60716f7cf3a75846ee1f5d38", }, }, Object { "_id": ..

Read more

I’m trying to migrate React Navigation 6 and I couldn’t resolve package conflicts with my old packages. Since this is pretty new package, I couldn’t find anything online, here is the error I’m getting; Do I have to upgrade the other packages first? Here is all react-nagivation packages in package.json; "@react-navigation/core": "^5.15.2", "@react-navigation/drawer": "^5.12.4", "@react-navigation/native": ..

Read more