troubleshooting
-
[React Navigation v6] TS2339: Property '..' does not exist on type 'Readonly<{.. } | {.. }>'Troubleshooting 2022. 9. 13. 16:06
중첩된 네비게이터의 루트의 파라미터를 받아올 때 타입 에러가 발생했다. CompositeScreenProps를 잘못 사용한 줄로만 알고 여러가지 방법을 시도를 했으나,, 문제 원인은 한 네비게이터의 ParamList를 작성할 때 아래와 같이 작성한 탓이었다. export type ParamList = { profile: { writingNo: number } | { profileNo: number }; } 아래는 React Navigation 공식 문서 내의 Type checking with Typescript 중 해당 내용을 발췌해 온 것이다. Specifying undefined means that the route doesn't have params. A union type with undefine..