I have a problem with ‘3.1 Build a Pure Component’ not building.
(MY FILEPATH)/flashcard-app/src/app.js:23
return (<div className='app'>
^
ParseError: Unexpected token
I presume it has something to do with Babel??
I’ve tried these from the Github project:
“babel-preset-es2015”: “^6.6.0”,
“babel-preset-react”: “^6.5.0”,
“babelify”: “^7.2.0”,
“live-server”: “^0.9.2”,
“watchify”: “^3.7.0”
and the latest:
“babel-preset-es2015”: “^6.24.1”,
“babel-preset-react”: “^6.24.1”,
“babelify”: “^7.3.0”,
“live-server”: “^1.2.0”,
“watchify”: “^3.9.0”
App.js
const cards = (state, action) => {
switch (action.type){
case 'ADD_CARD':
let newCard = Object.assign({}, action.data, {
score: 1,
id: +new Date
});
return state.concat([newCard]);
default:
return state || [];
}
};
const store = Redux.createStore(Redux.combineReducers({
cards
}));
const App = (props) => {
return (<div className='app'>
{props.children}
</div>);
};
ReactDOM.render(<App> Hello React </App>, document.getElementById('root'));