반응형
React/redux
-
[redux] 리덕스 라이브러리 - 스토어 간편하게 사용하기React/redux 2023. 3. 17. 15:15
리덕스 라이브러리란? 1. 상태를 체계적으로 관리할 수 있다. >> 프로젝트 규모가 클 때 적합하다. 2. 개발자 도구 지원해준다. 3. 미들웨어를 지원해준다. >> 비동기 작업이 용이하다. react-redux 사용하기 방법 1. 임시함수를 생성한다. import React from 'react'; import Counter from '../components/Counter'; import { connect } from 'react-redux'; import { increase, decrease } from '../modules/counter'; const CounterContainer = ({number,increase,decrease}) => { return ( ); }; const mapState..