라우트 파라미터를 설정해주면 나는 오류. 해결 잘 안돼서 정말 골칫거리
TS2322: Type '({ navigation, route }: OverviewScreenProps) => Element' is not assignable to type 'ScreenComponentType<ParamListBase, "MealsOverview"> | undefined'. Type '({ navigation, route }: OverviewScreenProps) => Element' is not assignable to type 'FunctionComponent<{}>'. Types of parameters '__0' and 'props' are incompatible. Type '{}' is missing the following properties from type 'OverviewScreenProps': navigation, route
Type '({ navigation }: HomeScreenProps) => Element' is not assignable to type 'ScreenComponentType<ParamListBase, "Home"> | unde
[사진]React component to render for this screen.Type '({ navigation }: HomeScreenProps) => Element' is not assignable to type 'ScreenComponentType<P...
www.inflearn.com
해결방법
export type RootStackParamList = {
MealsCategories: undefined;
MealsOverview: {categoryId: string};
};
const Stack = createNativeStackNavigator<RootStackParamList>();
스택 생성시에 <RootParamList>로 정확히 명시해주기
createNativeStackNavigator<RootStackParamList>();
이거 해결하고 너무 기뻐서 소리지름
오류나도 앱은 잘 실행되어서 문제 없어보이는데 자꾸 생기는 빨간줄이 날 너무 괴롭게했다.