Как правильно набрать RNavigation? Сейчас я делаю это в приложении.
export type DrawerNavigatorType = {
Store: unknown;
ImagesStudio: { images: string[] }; //
};
const Drawer = createDrawerNavigator();
const DrawerNavigator = () => (
<Drawer.Navigator>
<Drawer.Screen
name = "Store"
component = {StoreNavigator}
/>
<Drawer.Screen
name = "ImagesStudio"
component = {ImageStudioScreen}
/>
</Drawer.Navigator>
);
и на экране
type Prop = DrawerScreenProps<DrawerNavigatorType, "ImagesStudio">;
но я продолжаю получать
Type '({ navigation, route }: Prop) => React.JSX.Element' is not assignable to type 'ScreenComponentType<ParamListBase, "ImagesStudio"> | undefined'.
Type '({ navigation, route }: Prop) => React.JSX.Element' is not assignable to type 'FunctionComponent<{}>'.
Types of parameters '__0' and 'props' are incompatible.
Type '{}' is missing the following properties from type 'Prop': navigation, routets(2322)
types.d.ts(318, 5): The expected type comes from property 'component' which is declared here on type 'IntrinsicAttributes & RouteConfig<ParamListBase, "ImagesStudio", DrawerNavigationState<ParamListBase>, DrawerNavigationOptions, DrawerNavigationEventMap>'
Кто-нибудь знает, что я делаю неправильно?






Исправляется изменением
const Drawer = createDrawerNavigator();
к
const Drawer = createDrawerNavigator<DrawerNavigatorType>();