json.stringify

    useReducer로 useState 리팩터링 하기 (2)

    useReducer로 useState 리팩터링 하기 (2)

    useReducer에 대해 이론적인 부분만 공부하고 바로 리팩터링을 도전했더니 예상치 못한 이슈가 많이 발생했다. 1. 상태 업데이트 안됨 const simpleSymbolsReducer = (state, action) => { switch (action.type) { case "INIT": return action.payload; case "ADD": return state.map((symbol, i) => { if (i === action.idx) { return new Set([...symbol, action.symbol]); } else { return symbol; } }); case "REMOVE": return state.map((symbol, i) => { if (i === action.i..