Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React from 'react';
- import PropTypes from 'prop-types';
- const Users = ({ users, fetchUsers }) => (
- <div>
- <button onClick={() => fetchUsers()}>Click me!</button>
- <span>{users.length}</span>
- </div>
- );
- Users.propTypes = {
- users: PropTypes.array.isRequired,
- fetchUsers: PropTypes.func.isRequired,
- };
- export default Users;
Add Comment
Please, Sign In to add comment