2017-02-01 2 views
1

반응이있는 앱이 OurController입니다. OurController이 정상적으로 작동합니다. 모두가 잘 파일의모듈 빌드 실패 : SyntaxError : 예기치 않은 토큰 (10:40) 고정 데이터 테이블에 반응

const TextCell = ({rowIndex, data, col, ...props}) => (
    <Cell {...props}> 
    {data.getObjectAt(rowIndex)[col]} 
    </Cell> 
); 

시작은 곧 내가 그것을 주석으로

var FixedDataTable = require('fixed-data-table'); 
var React = require('react'); 

const Table = FixedDataTable.Table; 
const Column = FixedDataTable.Column; 
const Cell = FixedDataTable.Cell; 

const TextCell = ({rowIndex, data, col, ...props}) => (
    <Cell {...props}> 
    {data.getObjectAt(rowIndex)[col]} 
    </Cell> 
); 

class OurDataTable extends React.Component { 

이지만 : 예에서 다음 코드를 추가하면 전체 응용 프로그램을 나누기, 어떤 페이지가 브라우저에 렌더링되지 않습니다 나는 가능한

가깝게 튜토리얼을 따라하려는 오류가 w

Module build failed: SyntaxError: Unexpected token (10:40) 
const TextCell = ({rowIndex, data, col, {issue is here}...props}) => (

같다

https://github.com/facebook/fixed-data-table/blob/master/examples/ObjectDataExample.js

I : ...props 가리키는 화살표 i 번째, 그것은처럼 보이는 것은 ... (첫 번째 점에 화살표 점)

enter image description here

가이드는 fixed-data-table이 조각 인을 이해하지 않습니다 전체 파일이 일반적으로 중요하다는 것을 알고 있지만 코드가 TextCell을 추가 할 때까지 예상대로 작동한다고 약속합니다. 우리는 특정 바벨 로더가 있지만 좀 더 부탁 고정 데이터 테이블을 참조하지 않았다

var webpack = require('webpack'); 

module.exports = { 
    //devtool: 'inline-source-map', 
    entry: [ 
    'webpack-hot-middleware/client', 
    './client/main.js' 
    ], 
    output: { 
    path: require("path").resolve('./public'), 
    filename: 'bundle.js', 
    publicPath: '/' 
    }, 
    plugins: [ 
    new webpack.HotModuleReplacementPlugin() 
    ], 
    module: { 
    loaders: [ 
     { 
     test: /\.jsx?$/, 
     loader: 'babel-loader', 
     exclude: /node_modules/, 
     query: { 
      presets: ['react', 'es2015', 'react-hmre'] 
     } 
     } 
    ] 
    } 
}; 

급행 서버 마찬가지로 구성되고 우리는 사용하고

(뜨거운 재 장전 등) 작업 ES6 및 협력 일에 같은

class OurDataTable extends React.Component {

답변

1

있는지,하지만 난 그렇게 생각하지 같은 문제가 확산 운영자함께, transform-object-rest-spread plugin을 사용하려면 Babel을 구성해야합니다.

이를 설치하려면이 링크를 따라

+0

https://babeljs.io/docs/plugins/transform-object-rest-spread/, 그것은 몇 가지 이상한 로더라고 생각 했어요. 확인해 주셔서 감사합니다. – codyc4321

관련 문제