Flowtype在module.hot.accept

时间:2017-05-04 08:47:50

标签: webpack webpack-dev-server flowtype

我试图用flowtype检查一些代码:

export default function configureStore(initialState: initialStateType) {
    /* ... */
    if (module && module.hot) {
        module.hot.accept('../reducers', () => {
            const nextRootReducer = require('../reducers');
            store.replaceReducer(nextRootReducer);
        });
    }
    /* ... */
}

我收到此错误消息:

src/store/configureStore.js:14
 14:    module.hot.accept('../reducers', () => {
        ^ call of method `accept`. Method cannot be called on
 14:        module.hot.accept('../reducers', () => {
            ^^^^^^^^^^ property `hot` of unknown type

我该如何解决这个问题?

谢谢!

0 个答案:

没有答案