From f78da28da3ee30b0c458c10c97db9ae7d2c6372d Mon Sep 17 00:00:00 2001 From: eug-vs Date: Fri, 14 Aug 2020 19:19:04 +0300 Subject: feat: memoize PollCard component --- src/components/PollCard/PollCard.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/components/PollCard/PollCard.tsx b/src/components/PollCard/PollCard.tsx index a4c2144..749c6b7 100644 --- a/src/components/PollCard/PollCard.tsx +++ b/src/components/PollCard/PollCard.tsx @@ -45,7 +45,7 @@ const useStyles = makeStyles(theme => ({ } })); -const PollCard: React.FC = ({ poll, setPoll }) => { +const PollCard: React.FC = React.memo(({ poll, setPoll }) => { const classes = useStyles(); const { author, contents: { left, right }, vote } = poll; const { enqueueSnackbar } = useSnackbar(); @@ -114,6 +114,6 @@ const PollCard: React.FC = ({ poll, setPoll }) => { ); -}; +}); export default PollCard; -- cgit v1.2.3