| ์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | 30 | 31 |
- captionside
- ๊ตฌ๊ธํฐํธ
- ์ฃผ์
- liststyletype
- textshadow
- selectorslevel4
- liststyleimage
- ๋นํ๊ทธ
- ํผํ๊ทธ
- ์์ด๋์ ๋ ํฐ
- liststyleposition
- ๊ทธ๋ฃน์ ๋ ํฐ
- CDN
- textdecoration
- borderspacing
- fontweight
- borderstyle
- texttransform
- ํด๋์ค์ ๋ ํฐ
- formtag
- ์ถ์ฝ
- ํฅ์ค์ฝ๋
- ํฐํธ์จ์ดํธ
- bordercollapse
- ํ์ ์ ๋ ํฐ
- wordspacing
- inlineblock
- ์ ๋๋ฒ์ ์ ๋ ํฐ
- gtammertable
- ๋ชจ๋์นํฐํธ
- Today
- Total
็ก์
reducer / Redux / Redux Toolkit ๋ณธ๋ฌธ
๐ก reducer / Redux / Redux Toolkit์ ๊ด๊ณ
reducer, Redux, Redux Toolkit์ ๋ชจ๋ ์ํ ๊ด๋ฆฌ์ ๊ด๋ จ๋์ด ์์ง๋ง ๊ฐ๊ฐ์ ์ญํ ์ด ๋ค๋ฅด๋ค.
- reducer: ์ํ๋ฅผ ๋ณ๊ฒฝํ๋ ํจ์.
- Redux: ์ ์ญ ์ํ๋ฅผ ๊ด๋ฆฌํ๋ ๋ผ์ด๋ธ๋ฌ๋ฆฌ.
- Redux Toolkit: Redux๋ฅผ ์ฝ๊ณ ํจ์จ์ ์ผ๋ก ์ฌ์ฉํ ์ ์๋๋ก ๋ง๋ ๊ณต์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ.
โผ๏ธ reducer
reducer๋ ํ์ฌ State์ Action์ ๋ฐ์ ์๋ก์ด State๋ฅผ ๋ฐํํ๋ ํจ์์ด๋ค.
์ํ๋ฅผ ์ด๋ป๊ฒ ๋ณ๊ฒฝํ ์ง ์ ์ํ๋ ์ญํ ์ ํ๋ฉฐ, Redux๋ฟ๋ง ์๋๋ผ React์ useReducer์์๋ ์ฌ์ฉ๋๋ค.
(state, action) => newState
โผ๏ธ Redux
Redux๋ ์ ํ๋ฆฌ์ผ์ด์ ์ ์ ์ญ ์ํ๋ฅผ ๊ด๋ฆฌํ๋ ์ํ ๊ด๋ฆฌ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ด๋ค.
Store๋ฅผ ์ค์ฌ์ผ๋ก State๋ฅผ ๊ด๋ฆฌํ๋ฉฐ, Action → Dispatch → Reducer ๊ณผ์ ์ ํตํด ์ํ๋ฅผ ๋ณ๊ฒฝํ๋ค.
์ฆ, reducer๋ฅผ ์ฌ์ฉํ์ฌ ์ ์ญ ์ํ๋ฅผ ๊ด๋ฆฌํ๋ ์์คํ ์ด๋ผ๊ณ ๋ณผ ์ ์๋ค.
โผ๏ธ Redux Toolkit
Redux Toolkit(RTK)์ Redux๋ฅผ ์ฝ๊ณ ํจ์จ์ ์ผ๋ก ์ฌ์ฉํ ์ ์๋๋ก ๋ง๋ Redux ๊ณต์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ด๋ค.
๊ธฐ์กด Redux์์ ๋ฐ๋ณต์ ์ผ๋ก ์์ฑํด์ผ ํ๋ Action, Reducer, Store ์ค์ ๋ฑ์ ๊ฐ๋จํ๊ฒ ์์ฑํ ์ ์๋๋ก ๋ค์ํ API๋ฅผ ์ ๊ณตํ๋ค.
๋ํ์ ์ธ API
- configureStore()
- createSlice()
ํ์ฌ๋ Redux๋ฅผ ์ฌ์ฉํ ๊ฒฝ์ฐ Redux Toolkit ์ฌ์ฉ์ด ๊ณต์ ๊ถ์ฅ๋๋ค.
๐ reducer vs Redux vs Redux Toolkit ๐
| ๊ตฌ๋ถ | reducer | Redux | Redux Toolkit |
| ์ข ๋ฅ | ํจ์ | ์ํ ๊ด๋ฆฌ ๋ผ์ด๋ธ๋ฌ๋ฆฌ | Redux ๊ณต์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ |
| ์ญํ | State ๋ณ๊ฒฝ | ์ ์ญ State ๊ด๋ฆฌ | Redux๋ฅผ ๊ฐํธํ๊ฒ ์ฌ์ฉ |
| ์ฌ์ฉ ์์น | useReducer, Redux | ์ ํ๋ฆฌ์ผ์ด์ ์ ์ฒด | Redux ํ๋ก์ ํธ |
| ๋ํ ๊ธฐ๋ฅ | State ๋ณ๊ฒฝ ๋ก์ง | Store, Action, Dispatch ๊ด๋ฆฌ | configureStore(), createSlice() |
'<React>' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
| reducer์ reducers (0) | 2026.07.20 |
|---|---|
| Redux Toolkit (๋ฆฌ๋์ค ํดํท) (0) | 2026.07.16 |
| Redux (๋ฆฌ๋์ค) (0) | 2026.07.16 |
| useReducer (์ ์ฆ๋ฆฌ๋์) (0) | 2026.07.15 |
| Context API (์ฝํ ์คํธ ์์ดํผ์์ด) (0) | 2026.07.15 |
