mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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:
committed by
Facebook GitHub Bot
parent
35b913017b
commit
c8a479c641
+1
-1
@@ -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,
|
||||
};
|
||||
|
||||
+1
-1
@@ -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,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user