import { h, Component } from 'preact'; import PropTypes from 'prop-types'; import { userPropTypes } from '../src/components/common-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 } = this.props; return (
{user.name}
{user.name}
); } } SidebarUser.propTypes = { followUser: PropTypes.func.isRequired, user: PropTypes.objectOf(userPropTypes).isRequired, }; export default SidebarUser;