From 9013ea38ca549245442ef18aac199f9431973b60 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 20 Feb 2019 23:36:30 +0300 Subject: Refactor memo components --- vnext/src/components/Contact.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'vnext/src/components/Contact.js') 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 ( {user.unreadCount && {user.unreadCount}}
{user.lastMessageText}
); -}); +} -export default Contact; +export default React.memo(Contact); Contact.propTypes = { - user: UserType + user: UserType, + style: PropTypes.object }; -- cgit v1.2.3