skip to Main Content

Why I do not see any props in React Native?

I'm trying to pass some props to class component from function component via navigation. At Function component I'm writing: export default function StartScreen() { const navigation = useNavigation(); function onButtonPress(){ navigation.navigate("Main",{'test':'Test'}); } return( <> <AnimatedTouchable onPress={onButtonPress}></AnimatedTouchable> </> ) } At…

VIEW QUESTION

How to specify the type for the return of useNavigation – React native

I'm having some diffuculties specifing the parameters for a function (onError) that receive the return of a useNavigation()) import { BottomTabScreenProps } from '@react-navigation/bottom-tabs' import { CompositeScreenProps, NavigatorScreenParams, useNavigation } from '@react-navigation/native' import { NativeStackNavigationProp, NativeStackScreenProps } from '@react-navigation/native-stack' import…

VIEW QUESTION

React Navigation v6 usePreventRemoveContext is undefined error – React native

TypeError: (0, _$$_REQUIRE(_dependencyMap[1], "@react-navigation/native").usePreventRemoveContext) is not a function. (In '(0, _$$_REQUIRE(_dependencyMap[1], "@react-navigation/native").usePreventRemoveContext)()', '(0, _$$_REQUIRE(_dependencyMap[1], "@react-navigation/native").usePreventRemoveContext)' is undefined) This error is located at: in NativeStackViewInner (at NativeStackView.native.tsx:420) in RNCSafeAreaProvider (at SafeAreaContext.tsx:87) in SafeAreaProvider (at SafeAreaProviderCompat.tsx:46) in SafeAreaProviderCompat (at NativeStackView.native.tsx:419) in NativeStackView…

VIEW QUESTION
Back To Top
Search