일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 파이썬
- memory
- CPU 스케줄링
- 백준
- web
- 리덕스장바구니
- 분할메모리할당
- Spring
- 자료구조
- js to ts
- react-redux
- OS
- 알고리즘
- 프로그래머스
- 기초100제
- codeup
- error
- Redux
- 공부
- react
- C++
- 토이프로젝트
- Java
- 스프링
- 정렬
- 일상
- 코드업
- Operating System
- 타입스크립트
- 협업
- Today
- Total
목록react-redux (2)
감자튀김 공장🍟
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/6hGh3/btq1la14v41/DNaV9t7nZeMwAcO6HKOIFK/img.png)
폴더 구조 src | |- component ||- Cart.js ||- FinalCart.js | |- pages ||-MenuList.js pages/MenuList.js import React, {useState, useEffect} from 'react'; import axios from 'axios'; import {useDispatch} from 'react-redux'; import {addCart} from '../store/actions'; function MenuList(props) { const [products, setProducts] = useState([]); const dispatch = useDispatch(); const list2 = []; useEffect(() => {..
폴더 구조 src | |- store | |- actions || ||- index.js | |- reducers | |- cartReducer.js |- index.js store/actions/index.js export const addCart = (item) => { return { type: 'ADD_ITEM', payload: item, }; }; export const deleteCart = (item) => { return { type: 'DELETE_ITEM', payload: item, }; }; export const increment = (item) => { return { type: 'INCREMENT', payload: item, }; }; export const decremen..