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