Can someone help inspect my code here? I don't know where the syntax error is.
My eslint (atom editor) says:
Parsing error: Unexpected token, expected : (Fatal)
Here is the code:
const initialUserState = {}
const userReducer = (state = initialUserState, action: { type }) => {
console.log(type)
return state
}
I'm using babel-preset-env, which includes preset es2015, which then includes transform-es2015-destructuring.
And also, here is my babelrc config:
{
"presets": [
["env", {
"targets": {
"browsers": ["last 2 versions", "safari >= 7"],
"uglify": true
},
"modules": false
}],
"react"
],
"plugins": [
"transform-object-rest-spread",
"react-hot-loader/babel"
]
}
Thanks a lot.