yarn add redux react-redux
📁 redux / config / configStore.js
// 중앙 데이터 관리소(store)를 설정하는 부분
import { combineReducers, createStore } from "redux";
const rootReducer = combineReducers({
//모듈들이 객체 형태로 들어 갈 자리
})
const store = createStore(rootReducer)
export default store
📁 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();