Remove Touchable (base) from public API#57420
Open
huntie wants to merge 1 commit into
Open
Conversation
Summary: **Motivation** The public type for `Touchable` has zero overlap with its runtime value, and this API is undocumented. https://www.internalfb.com/code/fbsource/[86267213ee84]/xplat/js/react-native-github/packages/react-native/Libraries/Components/Touchable/Touchable.d.ts?lines=18-24 https://www.internalfb.com/code/fbsource/[86267213ee84]/xplat/js/react-native-github/packages/react-native/Libraries/Components/Touchable/Touchable.js?lines=966-986 Replaces D110483989 / react#57419. **Impact** This API was undocumented, and any type usages will have disagreed under the manual types vs the Strict API. - A load-bearing consumer of this was Uniwind, where types are fixed in uni-stack/uniwind#592. Changelog: [General][Breaking] - The `Touchable` root export is removed. If you are extending `Touchable` as a type, please use `ViewProps` instead. Differential Revision: D110488985
|
@huntie has exported this pull request. If you are a Meta employee, you can view the originating Diff in D110488985. |
|
Warning JavaScript API change detected This PR commits an update to
This change was flagged as: |
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:
Motivation
The public type for
Touchablehas zero overlap with its runtime value. This is an internal implementation object which is undocumented.react-native/packages/react-native/Libraries/Components/Touchable/Touchable.d.ts
Lines 18 to 24 in a7959dd
react-native/packages/react-native/Libraries/Components/Touchable/Touchable.js
Lines 966 to 986 in a7959dd
Replaces D110483989 / #57419.
Impact
This is a breaking change with few open source consumers. The
onTouchStartetc prop typings are part ofViewPropstoday, which is a suitable replacement.Across projects I've been testing for the Strict TypeScript API rollout, the only load bearing consumer was Uniwind — where I've sent a PR to address this.
Changelog:
[General][Breaking] - The
Touchableroot export is removed. If you are extendingTouchableas a type, please useViewPropsinstead.Differential Revision: D110488985