无法解决./Reducers反应原生

时间:2017-11-19 11:44:57

标签: javascript reactjs react-native

我遵循以下教程: https://medium.com/react-native-training/tutorial-react-native-redux-native-mobile-app-for-tracking-cryptocurrency-bitcoin-litecoin-810850cf8acc

当我运行我的应用程序时,收到以下错误消息:

  

无法解决./Reducers“   ” ./C:\Users\Bryan\Documents\React-native\AwesomeProject\src\Store.js: could not resolve C:\Users\Bryan\Documents\React-native\AwesomeProject\src\Reducers'   作为文件或作为   文件夹 “ ”名称“: ”UnableToResolveError“, ”类型“: ”UnableToResolveError“, ”错误“:[{}]}, ”类型“: ”bundling_error“}”

这是我的Store.js

import { Platform } from 'react-native';
import {
    createStore,
    applyMiddleware,
    compose
} from 'redux';
import devTools from 'remote-redux-devtools';
import promise from 'redux-promise';
import thunk from 'redux-thunk';
import logger from 'redux-logger';

import RootReducer from './Reducers';

const middleware = applyMiddleware(thunk, promise, logger);

const Store = createStore (
    RootReducer,
    compose(
        middleware,
        devTools({
            name: Platform.OS,
            hostname: 'localhost',
            port: 5678
        }),
    )
);

export default Store;

在我的Reducers文件夹中,我有以下文件:

CryptoReducer.js

export default function(state = [], action) {
    return state;
}

Index.js

import {combineReducers} from 'redux';
import CryptoReducer from './CryptoReducer.js';

export default combineReducers({
    crypto: CryptoReducer
});

为什么会出现此错误?任何人都可以解释为什么它不起作用以及如何解决这个问题?

0 个答案:

没有答案