Redux 프로젝트 생성
yarn add redux react-redux
src > redux > config > configStore.js
// 중앙 데이터 관리소 (store)
import { createStore } from "redux";
import { combineReducers } from "redux";
const rootReducer = combineReducers({});
const store = createStore(rootReducer);
export default store;
src > index.js
import React from "react";
import ReactDOM from "react-dom/client";
import "./index.css";
import App from "./App";
import reportWebVitals from "./reportWebVitals";
import { Provider } from "react-redux";
import store from "./redux/config/configStore";
const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(
<Provider store={store}>
<App />
</Provider>
);
reportWebVitals();
'React' 카테고리의 다른 글
[React] Redux Ducks 패턴 (0) | 2023.07.31 |
---|---|
[React] 인증/ 인가 (토큰, JWT) (0) | 2023.07.05 |
[React] 인증/ 인가 (세션) (0) | 2023.07.05 |
[React] 인증/ 인가 (쿠키) (0) | 2023.07.05 |
[React] Throttling/ Debouncing (0) | 2023.07.05 |