From 797705c00d84036dfcf7323f0b02cda01e1fc82a Mon Sep 17 00:00:00 2001 From: Sam Zhou Date: Thu, 15 May 2025 09:55:32 -0700 Subject: [PATCH] Make use of ref-as-prop support in examples (#51358) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/51358 Make use of the React 19 feature so that we can remove the remaining `forwardRef` in react native. Changelog: [Internal] Reviewed By: yungsters Differential Revision: D74812747 fbshipit-source-id: 7ded547ff62ca59d28abfc46a2f57466e2486acd --- .../examples/FlatList/BaseFlatListExample.js | 69 +++++++++---------- .../SectionList/SectionListBaseExample.js | 11 ++- .../js/examples/TextInput/ExampleTextInput.js | 12 +++- 3 files changed, 51 insertions(+), 41 deletions(-) diff --git a/packages/rn-tester/js/examples/FlatList/BaseFlatListExample.js b/packages/rn-tester/js/examples/FlatList/BaseFlatListExample.js index a325b8a1f82..3d46dd5dc97 100644 --- a/packages/rn-tester/js/examples/FlatList/BaseFlatListExample.js +++ b/packages/rn-tester/js/examples/FlatList/BaseFlatListExample.js @@ -70,42 +70,39 @@ type Props = $ReadOnly<{ const BaseFlatListExample: component( ref: React.RefSetter>, ...props: Props -) = React.forwardRef( - // $FlowFixMe[incompatible-call] - (props: Props, ref) => { - return ( - - {props.testOutput != null ? ( - - - {props.testOutput} - - {props.onTest != null ? ( -