나는 벨로우 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, I는 다음과 같이 작성하려고 더 많은 정보를 찾을 수 있습니다
. –
'const reducerData = Object.assign ({}, reducers); \t const를 감속기 = combineReducers ({ \t reducerData, \t 라우팅 : routerReducer, \t});' 그러나 나는 아직도 그것을 해결할 수 없습니다. 작성하는 방법을 실수로합니까? –
아, 해결 방법을 이해할 수 있습니다. 감사! –