Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6214

react-navigation navigation hook type

$
0
0

I am using this hook from react-navigation and instead of calling the hook again in different components, I want to pass navigation as a prop.

const navigation = useNavigation();...<MyButton     resetLocation={resetLocation}     navigation={navigation}  /> 

But I am unable to figure out the "type" for this navigation prop that I should pass into my MyButton component.

type MyButtonProps = {  resetLocation: (locationToReset: string) => void;  navigation: any;};export const MyButton: React.FunctionComponent<MyButtonProps> = ({  resetLocation,  navigation,

What should I replace navigation: any; with?


Viewing all articles
Browse latest Browse all 6214

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>