const initialState = {a: 12, b: 13} export function searchReducer(state = initialState, action) { switch (action.type) { case(consts.SEARCH_INIT) : let test = {...state} console.log("--- action.payload", "test") return state default: return state } }
Code
Module build failed: SyntaxError: Unexpected token (8:15)
the error indicates the spread (...)
In the console of Chrome I tried and it works. What's the problem?
.baberlrc :
{ "presets": [ "env", "react", flow ], "plugins": [ "transform-class-properties" ] }