Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Aug 7, 2015
1 parent 0bbb126 commit c628e0e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,16 @@ It is advisable that only top-level components of your app (such as route handle

### “Dumb” component is unaware of Redux

Let’s say we have a `<Counter />` “dumb” component with a number `counter` prop, and an `increment` function prop that it will call when user presses an “Increment” button:
Let’s say we have a `<Counter />` “dumb” component with a number `value` prop, and an `onIncrement` function prop that it will call when user presses an “Increment” button:

```js
import { Component } from 'react';

export default class Counter extends Component {
render() {
return (
<button onClick={this.props.increment}>
{this.props.counter}
<button onClick={this.props.onIncrement}>
{this.props.value}
</button>
);
}
Expand All @@ -97,14 +97,14 @@ import { increment } from '../actionsCreators';
// Which part of the Redux global state does our component want to receive as props?
function mapState(state) {
return {
counter: state.counter
value: state.counter
};
}

// Which action creators does it want to receive by props?
function mapDispatch(dispatch) {
return {
increment: () => dispatch(increment())
onIncrement: () => dispatch(increment())
};
}

Expand Down

0 comments on commit c628e0e

Please sign in to comment.