Modern Web Apps With React and Redux



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”


const cards = (state, action) => {
	switch (action.type){
		case 'ADD_CARD':
			let newCard = Object.assign({},, {
				score: 1,
				id: +new Date

			return state.concat([newCard]);

			return state || [];

const store = Redux.createStore(Redux.combineReducers({

const App = (props) => {
	return (<div className='app'>

ReactDOM.render(<App> Hello React </App>, document.getElementById('root'));


move the <div className='app'> on a newline.
using parens is an implicit return.
Try this:
const App = props => <div className="app">{props.children}</div>;

const App = (props_ => {
return {
<div className='app'>{ props.children }</div>

It gets confusing with the syntax for me as well.


I couldn’t get the formatting to work correctly but I hope you get the idea?


Your code is absolutely correct as is @conordarcy

Seems like something is wrong with some npm package that you are missing in your file.

Does your file have react and react dom imported?

try this

import React from 'react';
import ReactDOM from 'react-dom';