Guest User

Untitled

a guest
May 23rd, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. import React from 'react';
  2. import PropTypes from 'prop-types';
  3.  
  4. const propTypes = {
  5. count: PropTypes.number.isRequired,
  6. onIncrement: PropTypes.func.isRequired,
  7. onDecrement: PropTypes.func.isRequired,
  8. };
  9.  
  10. const Counter = ({ count, onIncrement, onDecrement }) => (
  11. <div>
  12. <span>{count}</span>
  13. <button onClick={onIncrement}>Increment</button>
  14. <button onClick={onDecrement}>Decrement</button>
  15. </div>
  16. );
  17.  
  18. Counter.propTypes = propTypes;
  19.  
  20. export default Counter;
Add Comment
Please, Sign In to add comment