diff options
author | Vitaly Takmazov | 2019-02-20 23:36:30 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-01-13 10:37:54 +0300 |
commit | 9013ea38ca549245442ef18aac199f9431973b60 (patch) | |
tree | 80bf933866e9ed8fcc8bf9527e243d7cb6cff93b /vnext/src/components/Contact.js | |
parent | 5e73cff8aa8d7b514933413fbeb9ea37d1153ecb (diff) |
Refactor memo components
Diffstat (limited to 'vnext/src/components/Contact.js')
-rw-r--r-- | vnext/src/components/Contact.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/vnext/src/components/Contact.js b/vnext/src/components/Contact.js index dd68d338..24aabe15 100644 --- a/vnext/src/components/Contact.js +++ b/vnext/src/components/Contact.js @@ -1,19 +1,21 @@ import React from 'react'; +import PropTypes from 'prop-types'; import { UserType } from './Types'; import Avatar from './Avatar'; -const Contact = React.memo(({ user, style, ...rest }) => { +function Contact({ user, style, ...rest }) { return ( <Avatar user={user} link={`/pm/${user.uname}`} style={style}> {user.unreadCount && <span className="badge">{user.unreadCount}</span>} <div className="msg-ts">{user.lastMessageText}</div> </Avatar> ); -}); +} -export default Contact; +export default React.memo(Contact); Contact.propTypes = { - user: UserType + user: UserType, + style: PropTypes.object }; |