mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2024-11-28 12:33:55 +03:00
26 lines
674 B
JavaScript
26 lines
674 B
JavaScript
import React, { Component, PropTypes } from 'react';
|
|
|
|
export default class Counter extends Component {
|
|
static propTypes = {
|
|
increment: PropTypes.func.isRequired,
|
|
incrementIfOdd: PropTypes.func.isRequired,
|
|
decrement: PropTypes.func.isRequired,
|
|
counter: PropTypes.number.isRequired
|
|
};
|
|
|
|
render() {
|
|
const { increment, incrementIfOdd, decrement, counter } = this.props;
|
|
return (
|
|
<p>
|
|
Clicked: {counter} times
|
|
{' '}
|
|
<button onClick={increment}>+</button>
|
|
{' '}
|
|
<button onClick={decrement}>-</button>
|
|
{' '}
|
|
<button onClick={incrementIfOdd}>Increment if odd</button>
|
|
</p>
|
|
);
|
|
}
|
|
}
|