import { h, Component } from 'preact'; import PropTypes from 'prop-types'; import userPropTypes from '../src/components/common-prop-types/user-prop-types'; class SidebarUser extends Component { constructor(props) { super(props); this.onClick = this.onClick.bind(this); } onClick() { const { followUser, user } = this.props; followUser(user); } render() { const { user, index } = this.props; return (
); } } SidebarUser.propTypes = { followUser: PropTypes.func.isRequired, user: PropTypes.objectOf(userPropTypes).isRequired, index: PropTypes.number.isRequired, }; export default SidebarUser;