Update return type for getNativeScrollRef methods (#56718)#56718
Open
huntie wants to merge 1 commit intofacebook:mainfrom
Open
Update return type for getNativeScrollRef methods (#56718)#56718huntie wants to merge 1 commit intofacebook:mainfrom
huntie wants to merge 1 commit intofacebook:mainfrom
Conversation
|
@huntie has exported this pull request. If you are a Meta employee, you can view the originating Diff in D104223704. |
Summary: Pull Request resolved: facebook#56718 Update the return type of `getNativeScrollRef` on `ScrollView`, `FlatList`, `SectionList` to be `PublicScrollViewInstance` (previously, a mix of `HostInstance` and `React.ElementRef<>` types which did not include the imperative methods of `ScrollView`). - This type extends `HostInstance & ScrollViewImperativeMethods`, and is what the `ScrollView` ref chain already returns at runtime. - The previous types were either too broad (`HostInstance`), wrong (union with `View`), or required `$FlowFixMe` suppressions. Also removes `ScrollViewNativeComponent` from the public API surface, since it is an internal implementation detail not intended for external use (equivalent props are on the pre-existing `ScrollViewBaseProps` type). Related to: - facebook#52203 - facebook#54735 Changelog: [General][Fixed] - **Strict TypeScript API**: Update `getNativeScrollRef` return type across ScrollView, FlatList, and SectionList Differential Revision: D104223704
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Update the return type of
getNativeScrollRefonScrollView,FlatList,SectionListto bePublicScrollViewInstance(previously, a mix ofHostInstanceandReact.ElementRef<>types which did not include the imperative methods ofScrollView).HostInstance & ScrollViewImperativeMethods, and is what theScrollViewref chain already returns at runtime.HostInstance), wrong (union withView), or required$FlowFixMesuppressions.Also removes
ScrollViewNativeComponentfrom the public API surface, since it is an internal implementation detail not intended for external use (equivalent props are on the pre-existingScrollViewBasePropstype).Related to:
getNativeScrollReftype forScrollView#52203Changelog:
[General][Fixed] - Strict TypeScript API: Update
getNativeScrollRefreturn type across ScrollView, FlatList, and SectionListDifferential Revision: D104223704