남과 같이 해선 남 이상이 될 수 없다.

TypeScript

[TypeScript] Property '...' does not exist on type 'DefaultRootState' - Redux type Error

맨동 2022. 3. 6. 18:57
728x90

Property 'nav' does not exist on type 'DefaultRootState'

 

React + TS + redux 사용중 

DefaultRootState 값에 찾는 값이 없다는 에러를 발견했다.

 

해결방법은rootReducer가 있는 곳에 RootState 타입을 선언하고 state에게 알려주면 해결완료!

export type RootState = ReturnType<typeof rootReducer>

 

728x90

'TypeScript' 카테고리의 다른 글

TypeScript - generic  (0) 2021.06.22
2021/06/22 TypeScript  (0) 2021.06.22
2021/06/21 TypeScript  (0) 2021.06.21
2021/06/19 TypeScript  (0) 2021.06.19
2021/06/17 TypeScript  (0) 2021.06.17