Type '({ navigation }: HomeScreenProps) => Element' is not assignable to type 'ScreenComponentType<ParamListBase, "Home"> | undefined'. ์๋ฌ
@react-navigation/core@6.2.2 ๋ฒ์ ์ด์ด๋ ๊ฐ์ ์๋ฌ๋ผ์ ๊ฒํง๊ธฐ์ง๋ง ๊ณต๋ถํ์ต๋๋ค.Type '({ navigation }: HomeScreenProps) => Element' is not assignable to type 'ScreenComponentType | undefined'.navigation ์ ์์๋ ScreenComponentType์ ๋ง์ง ์๋๋ค๋ ์๋ฏธ์ธ๊ฒ๊ฐ๊ณ ๊ฐ์ ์์ค์์ navigation์ ์ง์ (?)๋ ํ์
์ NativeStackScreenProps ์
๋๋ค.NativeStackScreenProps์ tpyes.d.ts์์๋ณด๋ฉด(์ฌ์ง)NativeStackScreenProps ์ผ๋ก ์ง์ ๋ ํ์
์์์๋ navigation์ด๋ route๋ ์ธ๋ถ type์ผ๋ก์ง์นญ๋์ด์ผ ํ๋๊ฒ์ผ๋ก ๋ณด์ฌ์ง๋๋ค.๊ทธ๋์ navigation ์ ํ๋ง ํ๋ ํ์ด์ง์ type ์ ์ธ์ NativeStackScreenProps -> NativeStackNavigationProp์ผ๋ก ๋ณ๊ฒฝํ๊ณ RN navigation ๊ณต์๋ฌธ์์ Annotating useNavigation์ ์ฐธ๊ณ ํ๋๋ ๊ณ ์ณ์ก์ต๋๋ค.https://reactnavigation.org/docs/typescript/#type-checking-screens(์ฌ์ง)