Closed wzup closed 7 years ago
What does colon mean here? Can't find info about it. From here https://github.com/CrocoDillon/universal-react-redux-boilerplate/blob/master/src/routes.js#L38
const configureRoutes = (store: Object) => {
Webpack compiles it as a plain vanilla function:
const x = (store: Object, set: Array) => { console.log(store, set) } // After Webpack var x = function x(store, set) { console.log(store, set); };
But Chrome throws error:
Uncaught SyntaxError: Unexpected token :
It's a Flowtype thing, the React Babel preset includes a plugin to remove it. I'm not totally convinced by Flowtype yet but I believe it will be good to have your setup at least ready for it.
What does colon mean here? Can't find info about it. From here https://github.com/CrocoDillon/universal-react-redux-boilerplate/blob/master/src/routes.js#L38
Webpack compiles it as a plain vanilla function:
But Chrome throws error: