그래서 저는 Wes Bos에 의해 자습서의 도움을 받아 react-redux를 배우고 싶었습니다.예기치 않은 토큰이 반응합니다
내가 github에 밀어 넣고 원격 서버에 넣을 때까지 모든 것이 잘되었다.
노드 버전 문제 일 수 있다고 생각했습니다. node ~ v5에서 실행 중이었고 서버가 ~ v6이었습니다. 그래서 나는 여전히 문제가있는 v5로 다시 변경했다.
import App from './components/app';
import Single from './components/Single';
import PhotoGrid from './components/PhotoGrid';
import { Router , Route , IndexRoute, browserHistory } from 'react-router';
import { Provider } from 'react-redux';
import store, { history } from './store';
const router = (
<Provider store={store}>
<Router history={history}>
<Route path="/" component={App}>
<IndexRoute component={PhotoGrid}></IndexRoute>
<Route path="/view/:postId" component={Single}/>
</Route>
</Router>
</Provider>
)
render(router,document.getElementById('root'));
그래서 19 번째 줄에 '예기치 않은 토큰'오류가 발생합니다.
18 | const router = (
> 19 | <Provider store={store}>
문제점을 파악할 수 없습니까? 구문 또는 일부 라이브러리에서 문제가 있습니까? 제안이나 도움이 정말 좋습니다.
코드를 실행중인 환경이 JSX를 인식하지 못하기 때문에 코드를 실행하기 전에 코드를 추출해보십시오. http://stackoverflow.com/questions/33460420/babel-loader-jsx-syntaxerror-unexpected-token –
[babel-loader jsx SyntaxError : 예상치 않은 토큰] 가능한 복제본 (http://stackoverflow.com/questions/33460420)을 참조하십시오./babel-loader-jsx-syntaxerror-unexpected-token) –