npm install --save react-redux @reduxjs/toolkit Create a file src/store/index.js and add following code in it: import { configureStore } from '@reduxjs/toolkit'; import { combineReducers } from 'redux'; const reducer = combineReducers({ // here we will be adding reducers }) const store = configureStore({ reducer, }) export default store; To link our app with the redux store update the main app file as follows: ... ... import { Provider } from 'react-redux'; import store from './store'; ReactDOM.render( <Provider store={store}> <App /> </Provider> , document.getElementById('root') );...
forward
Recent Comments
Archives
- November 2024
- July 2021
- December 2020
- November 2020
- September 2020
- August 2020
- July 2020
- April 2020
- March 2020
- February 2020
- January 2020
- December 2019
- October 2019
- April 2018
- March 2018
- February 2018
- January 2018
- December 2017
- November 2017
- March 2017
- January 2017
- December 2016
- November 2016
- October 2016
- June 2015
- May 2015
- April 2015