react-block-ui
react-block-ui copied to clipboard
In combination with MUI and rematch I am getting: Module not found: Can't resolve 'react-block-ui/reduxMiddleware' in
store.js
import { init } from '@rematch/core';
import createPersistPlugin from '@rematch/persist';
import { routerMiddleware, connectRouter } from 'connected-react-router';
import { createBrowserHistory } from 'history';
import reduxMiddleware from 'react-block-ui/reduxMiddleware'; // only for redux
import * as models from 'models';
export const history = createBrowserHistory();
const persistPlugin = createPersistPlugin({
blacklist: [
'persist',
],
whitelist: [
'user',
...
],
});
export default init({
models,
plugins: [persistPlugin],
redux: {
reducers: {
router: connectRouter(history),
},
middlewares: [
reduxMiddleware,
routerMiddleware(history),
],
},
});
Error
Double checking package installation
try import reduxMiddleware from 'react-block-ui/lib/reduxMiddleware';
try
import reduxMiddleware from 'react-block-ui/lib/reduxMiddleware';
Thank you! I was running with a similar issue and this helped me.
try
import reduxMiddleware from 'react-block-ui/lib/reduxMiddleware';
then it would error this:
Could not find a declaration file for module 'react-block-ui/lib/redux'. '.../node_modules/react-block-ui/lib/redux.js' implicitly has an 'any' type. If the 'react-block-ui' package actually exposes this module, try adding a new declaration (.d.ts) file containing
declare module 'react-block-ui/lib/redux';