Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function ReRenderWithNonPureChildGoodExample(): React.Node {
export default {
title: 'List re-render due to not pure or memoized',
description:
'The List component is not pure in the bad example. Even though all props are not changed, it will still re-render when parent re-renders.',
'Get horizontal scroll offset.\nThe List component is not pure in the bad example. Even though all props are not changed, it will still re-render when parent re-renders.',
Bad: ReRenderWithNonPureChildBadExample,
Good: ReRenderWithNonPureChildGoodExample,
};
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function ReRenderWithObjectPropGoodExample(): React.Node {
export default {
title: 'Re-render from new object reference in prop',
description:
'Even with pure or memoized child component, if a new object reference is passed down as prop, the child component will still re-render unnecessarily. The onScroll callback is passed without useCallback hook in the bad example and caused performance issues.',
'Get horizontal scroll offset.\nEven with pure or memoized child component, if a new object reference is passed down as prop, the child component will still re-render unnecessarily. The onScroll callback is passed without useCallback hook in the bad example and caused performance issues.',
Bad: ReRenderWithObjectPropBadExample,
Good: ReRenderWithObjectPropGoodExample,
};