2022/03/19 리액트ts에서 특정 reducer의 state를 지정시 컴파일 에러
임시방편 :any


testReducer가 분명 존재하고 분명 console 창에서는 testR이 제대로 띄워지고 있으나 React TS 상에서 컴파일 되지 않는 문제가 발생
이럴 때 임시 방편으로 state 인자에 any type을 선언해준다.


컴파일도 되고 콘솔에 testR도 제대로 띄워진다.
보다 근본적인 해결책
Redux 공식 문서 및 스택 오버플로우 참조 :
https://redux-toolkit.js.org/tutorials/typescript
TypeScript Quick Start | Redux Toolkit
redux-toolkit.js.org
TS2339: Property 'tsReducer' does not exist on type 'DefaultRootState'
Struggling with the above question. Seen similar questions but cannot figure it out. The below code is me attempting to open and close a dialog using TypeScript for first time in an existing React
stackoverflow.com
계속 개발하다가 Redux toolkit으로 바꾸었다. 그리고 reducer의 타입 지정을 위한 근본적인 해결책 또한 알게 되었다.

