我正在为我的 redux 使用 @rematch/core 和 @rematch/loading。
目前面临一些问题。当我放置加载插件时,不断返回我Reducer "loading" returned undefined during initialization.
import {
init, RematchDispatch, RematchRootState,
} from '@rematch/core';
import { createBrowserHistory } from 'history';
import { connectRouter } from 'connected-react-router';
import loading from '@rematch/loading';
import { models, RootModel } from './models';
const history = createBrowserHistory();
const loadingPlugin = loading({});
const rootReducer = () => ({
router: connectRouter(history),
});
export const store = init({
models,
plugins: [loadingPlugin],
redux: {
reducers: rootReducer(),
},
});
export type Store = typeof store;
export type RootDispatch = RematchDispatch<RootModel>;
export type RootState = RematchRootState<RootModel>;
有什么解决办法吗?
谢谢。