Skip to content

Commit

Permalink
chore: add missing dependencies to memoized components
Browse files Browse the repository at this point in the history
  • Loading branch information
AXeL-dev committed Nov 5, 2022
1 parent dbd4220 commit 65fb56a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ function propsAreEqual(
return (
prevProps.view === nextProps.view &&
prevProps.channel.id === nextProps.channel.id &&
prevProps.count === nextProps.count &&
prevProps.total === nextProps.total &&
prevProps.isLoading === nextProps.isLoading &&
prevProps.itemsPerRow === nextProps.itemsPerRow &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ function propsAreEqual(
prevProps: ChannelTitleProps,
nextProps: ChannelTitleProps,
) {
return prevProps.channel.id === nextProps.channel.id;
return (
prevProps.view === nextProps.view &&
prevProps.channel.id === nextProps.channel.id
);
}

export default React.memo(ChannelTitle, propsAreEqual);

0 comments on commit 65fb56a

Please sign in to comment.