From 739cf773bf6ae4fa72361bbc1a967ee4c3a3b54f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=B0=EC=98=81=EC=84=AD?= <37991768+byseop@users.noreply.github.com> Date: Thu, 26 Sep 2019 18:56:28 +0900 Subject: [PATCH] Update 05-ts-redux.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 오타가 있는것 같아 수정하였습니다. --- using-typescript/05-ts-redux.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/using-typescript/05-ts-redux.md b/using-typescript/05-ts-redux.md index 22afc02..a6e6ea2 100644 --- a/using-typescript/05-ts-redux.md +++ b/using-typescript/05-ts-redux.md @@ -162,7 +162,7 @@ src 디렉터리에 components 디렉터리를 생성하고, 그 안에 Counter. ```javascript import React from 'react'; -type CounterProps { +type CounterProps = { count: number; onIncrease: () => void; onDecrease: () => void; @@ -204,7 +204,7 @@ import { RootState } from '../modules'; import { increase, decrease, increaseBy } from '../modules/counter'; import Counter from '../components/Counter'; -function CounterContainer () => { +function CounterContainer () { // 상태를 조회합니다. 상태를 조회 할 때에는 state 의 타입을 RootState 로 지정해야합니다. const count = useSelector((state: RootState) => state.counter.count); const dispatch = useDispatch(); // 디스패치 함수를 가져옵니다 @@ -998,4 +998,4 @@ export * from './types'; // 모든 타입들을 불러와서 같은 이름들로 앞으로 리덕스 코드를 작성하게 될 때 만약 처리하는 액션의 수가 그렇게 많지 않다면 파일 하나로도 충분 할 수 있겠지만, 처리 할 액션의 수가 많아진다면 이렇게 여러개의 파일로 분리해서 작성하는 것을 권장드립니다. -다음 섹션에서는 리덕스 미들웨어 redux-thunk 와 redux-saga 를 사용 할 때 타입스크립트를 어떻게 활용 할 수 있는지 다뤄보도록 하겠습니다. \ No newline at end of file +다음 섹션에서는 리덕스 미들웨어 redux-thunk 와 redux-saga 를 사용 할 때 타입스크립트를 어떻게 활용 할 수 있는지 다뤄보도록 하겠습니다.