I am working new project. I started using typescript in this project. When I started the new project, I used react navigation 5x version. My question, how to define interface destructed navigation prop type in react navigation 5x version ? I don't use any type. I readed document react navigation, but i don't find my question. Thanks a lot. Have a nice days. 👋
import React from 'react';
import {Button, Text, SafeAreaView} from 'react-native';
import {inject, observer} from 'mobx-react';
import {Col, Grid} from 'react-native-easy-grid';
import Stores from '../../stores/storeIdentifier';
import ThemeStore from '../../stores/themeStore';
interface Props {
navigation: any;
}
interface InjectedProps extends Props {
themeStore: ThemeStore;
}
export function ModalComponent(props: Props) {
const {themeStore, navigation} = props as InjectedProps;
return (
<SafeAreaView style={themeStore.styleSheet.globalModal__container}>
<Grid>
<Col
style={[
themeStore.styleSheet.alignCenter,
themeStore.styleSheet.justifyCenter,
]}>
<Text>Welcome to Global Modal 👋</Text>
<Button onPress={() => navigation.goBack()} title="Back" />
</Col>
</Grid>
</SafeAreaView>
);
}
export const Modal = inject(Stores.ThemeStore)(observer(ModalComponent));