mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Make use of ref-as-prop support in SectionListModern (#51360)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/51360 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: D74812991 fbshipit-source-id: 9df7247bcdaed7a880ed0a75a5dcc33fce6f1d86
This commit is contained in:
1 parent
6e9a816940
commit
e7e4cdd12e
1 file changed
+8
-2
@@ -168,7 +168,13 @@ export type Props<ItemT, SectionT = DefaultSectionT> = $ReadOnly<{
|
||||
const SectionList: component(
|
||||
ref?: React.RefSetter<any>,
|
||||
...Props<any, DefaultSectionT>
|
||||
) = forwardRef<Props<any, DefaultSectionT>, any>((props, ref) => {
|
||||
) = ({
|
||||
ref,
|
||||
...props
|
||||
}: {
|
||||
ref?: React.RefSetter<any>,
|
||||
...Props<any, DefaultSectionT>,
|
||||
}) => {
|
||||
const propsWithDefaults = {
|
||||
stickySectionHeadersEnabled: Platform.OS === 'ios',
|
||||
...props,
|
||||
@@ -237,6 +243,6 @@ const SectionList: component(
|
||||
getItem={(items, index) => items[index]}
|
||||
/>
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
export default SectionList;
|
||||
Reference in new issue
Block a user