Right now we are using easy peasy in our project, now we want to remove easy peasy store gradually and replace it with reduxtoolkit. Can we use stores with different libraries in react? Or is any alternative way to deal with this situation.
Tried below which is not working:
**Creating store out of reduxtoolkit**
import { configureStore,combineReducers } from "@reduxjs/toolkit";
import appReducer from "./slice/appReducer";
const rootReducer= combineReducers({
app: appReducer,
});
const store = configureStore({
reducer: rootReducer,
});
**For easy peasy**
import models from './models';
import { createStore } from 'easy-peasy';
const store = createStore(models);
**In main file**
<Provider store={store }>
<Provider store={reduxStore }>
<App/>
</Provider>
</Provider>
**It is failing with Error:**
easy-peasy.esm.js:93 Uncaught TypeError: store.getActions is not a function
Basically Missing step from my side was Importing Provider from correct package.
Changing my code with above line helped me in solving problem.