1
我正在使用bellow babelrc設置。如何解決意外的令牌錯誤?
{
"presets": ["es2015", "react"]
}
然後,我當我使用......減速我得到意外的標記錯誤。 你知道如何解決它嗎? 我預計原因是減速機設置。 如果我在babelrc上添加'stage-1'。它可以解決。 但我不想添加它。請告訴我,除了在babelrc上添加'stage-1'外。
謝謝!
index.js
import React from 'react';
import ReactDOM from 'react-dom';
import { createStore, combineReducers, applyMiddleware, compose } from 'redux';
import { Provider } from 'react-redux';
import { Router, Route, IndexRoute, browserHistory } from 'react-router';
import { syncHistoryWithStore, routerReducer } from 'react-router-redux';
import thunk from 'redux-thunk';
import * as storage from './persistence/storage';
import randomToken from './utlis/random';
import getPastDays from './utlis/pastFutureDays';
import * as reducers from './reducers';
import {
App,
Home,
} from './components';
import style from './css/style.css';
const reducer = combineReducers({
...reducers,
routing: routerReducer,
});
./reducers/application.js
import { REGISTER_TOKEN } from '../constants';
const initialState = {
token: null,
createdAt: null,
};
export default function access(state = initialState, action) {
if (action.type === REGISTER_TOKEN) {
return { token: state.token };
}
return state;
}
./reducers/index.js
export { default as cityForecast } from './cityForecast';
export { default as application } from './application';
Uhmm,我嘗試寫這樣。 –
'const reducerData = Object.assign({},redurs); \t常量減速= combineReducers({ \t reducerData, \t路由:routerReducer, \t});' 但我仍然無法解決它。 我會犯錯怎麼寫? –
啊,我可以理解如何解決它。謝謝! –