From d01d3369318b79f4f38820ef8c48344a6b082aff Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 21 Feb 2019 00:20:21 +0300 Subject: More pure components --- vnext/src/components/Message.js | 14 ++++++++------ vnext/src/components/NavigationIcon.js | 4 +++- vnext/src/components/PM.js | 4 +++- vnext/src/components/Spinner.js | 4 +++- 4 files changed, 17 insertions(+), 9 deletions(-) (limited to 'vnext/src') diff --git a/vnext/src/components/Message.js b/vnext/src/components/Message.js index 032504c3..6afb8d96 100644 --- a/vnext/src/components/Message.js +++ b/vnext/src/components/Message.js @@ -11,7 +11,7 @@ import { format } from '../utils/embed'; import './Message.css'; -const Message = React.memo(({ data, visitor, children, ...rest }) => { +function Message({ data, visitor, children, ...rest }) { return (
@@ -25,7 +25,7 @@ const Message = React.memo(({ data, visitor, children, ...rest }) => {
- +

= 0) }}>

@@ -82,11 +82,11 @@ const Message = React.memo(({ data, visitor, children, ...rest }) => { {children}
); -}); +} -export default Message; +export default React.memo(Message); -const Tags = React.memo(({ data, user, ...rest }) => { +function Tags({ data, user, ...rest }) { return data.length > 0 && (
{ @@ -96,7 +96,9 @@ const Tags = React.memo(({ data, user, ...rest }) => { }
); -}); +} + +const TagsList = React.memo(Tags); Message.propTypes = { data: MessageType, diff --git a/vnext/src/components/NavigationIcon.js b/vnext/src/components/NavigationIcon.js index 5c5415ef..0a22ac57 100644 --- a/vnext/src/components/NavigationIcon.js +++ b/vnext/src/components/NavigationIcon.js @@ -5,7 +5,7 @@ import Icon from './Icon'; import './NavigationIcon.css'; -export default function NavigationIcon(props) { +function NavigationIcon(props) { return (