useContext์์ useReducer๋ฅผ ํตํด redux์ฒ๋ผ ์ฌ์ฉํด ๋ณด๋๋ก ํ๊ฒ ์ต๋๋ค. ๊ธฐ๋ฅ์ ๊ฐ๋จํ๊ฒ admin์ด๋ผ๋ state๋ฅผ ๊ฐ์ง๊ณ true์ผ ๋ false์ผ ๋ ๋ฌธ๊ตฌ๋ง ๋ค๋ฅด๊ฒ ์ถ๋ ฅํ๋๋ก ํ์์ต๋๋ค. ์์ ์ useContext๊ฐ redux๋ฅผ ๋์ฒดํ ์ ์์ ๋งํผ ํธ๋ฆฌํ๋ค๊ณ ํ์ฌ ์์ ํ๋ก์ ํธ ํ๋๋ฅผ redux๋ฅผ ์ฌ์ฉํ์ง ์๊ณ useContex๋ง ์ฌ์ฉํด์ ๋ง๋ค์ด๋ณธ ์ ์ด ์๋ค. ๋จผ์ context๋ฅผ ์์ฑํฉ๋๋ค. import { createContext, useReducer } from "react"; // reducer const initialState = { admin: false } const reducer = (state, action) => { switch(action.type) { cas..