Replace use of private HostInstance types in Fantom tests#56947
Closed
huntie wants to merge 2 commits into
Closed
Conversation
Summary: Discovered while I try to understand the best shape for ref types. We have no other 1P component usage pattern for `React.ElementRef<ViewNativeComponentType>`, except for two now-removed fbsource instances, replaced with `React.ElementRef<typeof View>`. Changelog: [Internal] Reviewed By: cortinico Differential Revision: D106093290
Summary: #### Motivation - This aligns with how all `xplat/js` callers need to access this type via the public Flow API. This leaves `HostInstance` (exported at root) as the remaining exception to the rule — and remains an open design problem I'm looking to address in T270727973 (via RN WG consultation). Differential Revision: D106128324
|
@huntie has exported this pull request. If you are a Meta employee, you can view the originating Diff in D106128324. |
Collaborator
|
This pull request was successfully merged by @huntie in b32a6c9 When will my fix make it into a release? | How to file a pick request? |
|
This pull request has been merged in b32a6c9. |
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:
Context
For the Strict TypeScript API rollout, I'm understanding how we've defined, exposed, and applied component ref/element types for built-in React Native components. These are currently inconsistent and breaking between languages (Flow, manual TS types, and generated Strict TS types) and are a key surface area for migration incompatibilities and user confusion.
As a first phase, I want to align all Flow usages towards one pattern — even if this isn't the pattern we end up shipping for TypeScript.
This diff
Replace use of the private
TextInputInstancetype in our Fantom test code.TextInput-itest.jsnow depends on public APIs only, and aligns with how external Flow callers (xplat/js) need to access this type.Notably, this preserves
HostInstance(<View>) uses (exported at root) as the remaining exception to the rule — which remains an open design problem I'm looking to address in T270727973 (via RN WG consultation).Changelog: [Internal]
Differential Revision: D106128324