Update example description to help understand them better (#38797)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38797

Changelog:
[Internal] - Refactor description to performance comparison examples in RNTester

Reviewed By: christophpurrer

Differential Revision: D47892300

fbshipit-source-id: 8006cbef9f30472adc54ebf0f87a8b52c840a824
This commit is contained in:
Xin Chen
2023-08-16 13:27:40 -07:00
committed by Facebook GitHub Bot
parent 35b913017b
commit c8a479c641
2 changed files with 2 additions and 2 deletions
@@ -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,
};
@@ -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,
};