I want to show you my problem.
My env:
Node: 8.9.1
npm: 5.6.0
yarn: 1.3.2
package.json
\"devDependencies\": {
In order to use spread syntax, you need to configure you babel loader, You have a couple of option
First: Use plugin "transform-object-rest-spread"
Install it using
npm install --save-dev babel-plugin-transform-object-rest-spread
and use it
options: {
cacheDirectory: true,
presets: ['react', 'env']
plugins: ['transform-object-rest-spread']
}
Second: use stage-0 preset, Install it using
npm install --save-dev babel-preset-stage-0
and use it like
options: {
cacheDirectory: true,
presets: ['react', 'env', 'stage-0']
}
Check this babel-documentation