Guest User

Untitled

a guest
Dec 11th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. import React from 'react';
  2. import PropTypes from 'prop-types';
  3.  
  4.  
  5. const Users = ({ users, fetchUsers }) => (
  6. <div>
  7. <button onClick={() => fetchUsers()}>Click me!</button>
  8. <span>{users.length}</span>
  9. </div>
  10. );
  11.  
  12. Users.propTypes = {
  13. users: PropTypes.array.isRequired,
  14. fetchUsers: PropTypes.func.isRequired,
  15. };
  16.  
  17. export default Users;
Add Comment
Please, Sign In to add comment