diff --git a/src/actions.js b/src/actions.js index ea49772..64e85ec 100644 --- a/src/actions.js +++ b/src/actions.js @@ -1,8 +1,8 @@ export default { countIncrease (){ - return {type: 'COUNT_INC'}; + return { type: 'COUNT_INC' } }, countDecrease (){ - return {type: 'COUNT_DEC'}; + return { type: 'COUNT_DEC' } } -}; \ No newline at end of file +} diff --git a/src/app.js b/src/app.js index d70f2e4..d555ac2 100644 --- a/src/app.js +++ b/src/app.js @@ -6,8 +6,8 @@ import routes from './routes' import store from './store' ReactDom.render( - - + + , document.getElementById('app') -); \ No newline at end of file +) diff --git a/src/components/count.js b/src/components/count.js index a902d86..d5fa15a 100644 --- a/src/components/count.js +++ b/src/components/count.js @@ -1,39 +1,38 @@ -import React, { Component, PropTypes } from 'react' +import React, { PropTypes } from 'react' import { connect } from 'react-redux' import actions from '../actions' -class Count extends Component { - render () { - const { currentValue, increase, decrease } = this.props; - return ( -
-

Count

-

Current count: {currentValue}

-

- - -

-
- ) - } +const Count = (props) => { + const { currentValue, increase, decrease } = props + + return ( +
+

Count

+

Current count: { currentValue }

+

+ + +

+
+ ) } Count.propTypes = { increase : PropTypes.func.isRequired, decrease : PropTypes.func.isRequired -}; +} -const mapStateToProps = (state) => state.count; +const mapStateToProps = (state) => state.count const mapDispatchToProps = (dispatch) => { return { increase() { - dispatch(actions.countIncrease()); + dispatch(actions.countIncrease()) }, decrease() { - dispatch(actions.countDecrease()); + dispatch(actions.countDecrease()) } } -}; +} -export default connect(mapStateToProps, mapDispatchToProps)(Count); \ No newline at end of file +export default connect(mapStateToProps, mapDispatchToProps)(Count) diff --git a/src/components/home.js b/src/components/home.js index 88dba2b..a1ab7c2 100644 --- a/src/components/home.js +++ b/src/components/home.js @@ -1,15 +1,12 @@ -import React, { Component } from 'react'; - -export default class Home extends Component { - render() { - return ( -
-

Hello World!

-

Simple static component with not special content at all.

-
- ) - } +import React from 'react' + +const Home = () => { + return ( +
+

Hello World!

+

Simple static component with not special content at all.

+
+ ) } - - +export default Home diff --git a/src/components/nav.js b/src/components/nav.js index 81ec4b3..598304f 100644 --- a/src/components/nav.js +++ b/src/components/nav.js @@ -1,17 +1,16 @@ -import React, { Component } from 'react' +import React from 'react' import { Link } from 'react-router' -export default class Nav extends Component { - render () { - return ( -