当我运行我的应用程序时,收到以下错误消息:
无法解决./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
});
为什么会出现此错误?任何人都可以解释为什么它不起作用以及如何解决这个问题?