목록2025/01/15 (1)
flatwhite01 님의 블로그
import { createSlice } from '@reduxjs/toolkit';//자바스크립트 영역 toolkit 내부에 지원해준다const initialState = { count: 0,};export const counterSlice = createSlice({ name: 'counter', initialState, reducers: { increment: (state, action) => { // action.payload => UI 디자인에서 값을 넘긴것을 받기 //state.키 =>initialState 에 초기변수 연결 state.count += 1; }, decremen..
react
2025. 1. 15. 10:49