I’m having some diffuculties specifing the parameters for a function (onError) that receive the return of a useNavigation()) TS playground Answer I have not personally worked with @react-navigation, so I’m going by the types only, but it looks like useNavigation, when called without type parameters, defaults to ReactNavigation.RootParamList which doesn’t match your RootStackParamList. The non-extistent replace method comes from the
Tag: react-navigation
Refresh same page with different parameters using React Navigation
I am using React Navigation to navigate between pages. I have a Profile page that contains user info card and that user’s posts. I use Post component inside this Profile component as shown below. And I have a link button to navigate users profile inside the Post component. I also use this Post component inside Home Page and navigation is
React Navigation navigation.navigate(“SomeScreen”) error in TypeScript
A common error which occurs in react-navigation, when using TypeScript, is: Argument of type ‘string’ is not assignable to parameter of type ‘{ key: string; params?: undefined; merge?: boolean | undefined; } | { name: never; key?: string | undefined; params: never; merge?: boolean | undefined; }’ What could this be caused by? Answer This occurs when types for specific
fetching and passing params in react navigation
On Press of a button I need to pass params to another screen where value of that button is fetched, code below; screen:1 screen:2 But during the fetching I get the following error I have tried using timeout but that is not working, is there a better option. Answer The issue is that fetch is a native function in javascript
undefined is not an object (evaluating ‘navigation.navigate’) when trying to navigate to a file that will open camera on the phone
I’m trying to navigate to my page “CameraPage.js” but I’m getting this error “undefined is not an object (evaluating ‘navigation.navigate’)”. Can anybody see the problem? This ismy first question here so please tell me if I can be more specific. Here’s my App.js: Here is my CameraPage.js file: Here is my navigation file: Answer Your navigation container must be wrapped
React Native, passing data between screens when using BottomTabsNavigator
I am trying to make a react native application. I am using Bottom Tab Navigation, and I have 2 screens. On the first screen, a qr code is first scanned, it contains a string, which is written on the screen. Then I would like to write out the afformentioned string on the second tab. How can I pass this data
React native Context API react-navigation
React native: ^0.64.0, @react-navigation/native-stack: ^6.1.0 @react-navigation/bottom-tabs: 6.0.5 @react-navigation/native: 6.0.2 I have a login screen. If the user passes the login screen the app leads the user to a the main part of the app. This is is the MainScreen with a bottom tab bar. The bottom tab bar gives the user the option to move between EditProfileScreen, SetupsScreen & TipsScreen.
hi i’m using react-native and react-navigation
when i try to navigation.navigate this error occure Cannot read property ‘navigate’ of undefined this is my code when i try to navigation.navigate this error occure Cannot read property ‘navigate’ of undefined this is my code card.js navigator.js i don’t know how can i resolve…. please help me this is error view Answer This Worked for me!
Press tab to scroll to top of flatlist
I would like to implement scrolling to top. My tab is a flatlist, and when users scroll down the flatlist, they have to scroll back up. Instagram and Twitter allow you to press the tab to scroll back up, I am wondering how to implement it in my own app. Here is the tab I want to implement scrolling to
Navigate between different components React Native
So I’ve been trying to understand how to do this for like 2 hours now but I can’t seem to figure it out. I want to be able to go from one component to another when the button is clicked. First.js Second.js So I cut out some of my code with all the extra stuff but above is the two