diff options
author | eug-vs <eug-vs@keemail.me> | 2020-08-14 19:19:04 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-08-14 19:19:04 +0300 |
commit | f78da28da3ee30b0c458c10c97db9ae7d2c6372d (patch) | |
tree | 0a7db175977a05feac099755db9a08102eac27e0 /src | |
parent | c3ebdfe3b959f0d4a670e08176e71906107041af (diff) | |
download | which-ui-f78da28da3ee30b0c458c10c97db9ae7d2c6372d.tar.gz |
feat: memoize PollCard component
Diffstat (limited to 'src')
-rw-r--r-- | src/components/PollCard/PollCard.tsx | 4 |
1 files changed, 2 insertions, 2 deletions
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<PropTypes> = ({ poll, setPoll }) => { +const PollCard: React.FC<PropTypes> = 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<PropTypes> = ({ poll, setPoll }) => { </div> </Card> ); -}; +}); export default PollCard; |