Skip to content

fix: Remove reference to Touchable in package types#592

Merged
Brentlok merged 1 commit into
uni-stack:mainfrom
huntie:remove-rn-touchable-type
Jul 7, 2026
Merged

fix: Remove reference to Touchable in package types#592
Brentlok merged 1 commit into
uni-stack:mainfrom
huntie:remove-rn-touchable-type

Conversation

@huntie

@huntie huntie commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Motivation

Align Uniwind with modern/real types from the react-native package. This is a load bearing breakage for users under React Native's Strict TypeScript API and we are likely removing this export in React Native 0.87.

Problem

We found a load bearing call site in Uniwind where the Touchable type is imported from react-native and used for the ScrollViewProps type augmentation.

import {
ScrollViewProps,
ScrollViewPropsAndroid,
ScrollViewPropsIOS,
Touchable,
VirtualizedListProps,
} from 'react-native'

interface ScrollViewProps extends ViewProps, ScrollViewPropsIOS, ScrollViewPropsAndroid, Touchable {

There are two issues with this:

  • The Touchable type shouldn't really exist in core (see below).
  • Extending this type is redundant, as onTouchStart etc are already present on ViewProps.

Fix

Simplify types.d.ts to factor out Touchable. No type shape / functional changes.


Mini-dive: This was a nonsense type(!)

Touchable today is a manually maintained TypeScript definition shadowing a runtime object that has no overlap.

Current (manual) TS definition:

image

https://github.com/react/react-native/blob/a7959ddc983855cc40390d637aadbfb213e7c3a7/packages/react-native/Libraries/Components/Touchable/Touchable.d.ts#L18-L24

vs the real object with two props — an internal implementation object with Mixin and renderDebugView:

image

https://github.com/react/react-native/blob/a7959ddc983855cc40390d637aadbfb213e7c3a7/packages/react-native/Libraries/Components/Touchable/Touchable.js#L966-L971

We're actually going to pursue removing this, which may land in RN 0.87.

Summary by CodeRabbit

Summary by CodeRabbit

  • Refactor
    • Updated React Native type definitions to use a shared base for scroll-related props.
    • Improved consistency in supported props across list and scroll components, reducing TypeScript type mismatches.
@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a7e9c174-d3b9-4920-974d-329935418806

📥 Commits

Reviewing files that changed from the base of the PR and between f145833 and 341c40b.

📒 Files selected for processing (1)
  • packages/uniwind/types.d.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/uniwind/types.d.ts

📝 Walkthrough

Walkthrough

Updated React Native type augmentations in packages/uniwind/types.d.ts to introduce a shared ScrollViewPropsBase alias and change two interfaces to extend from it.

Changes

Type Declaration Update

Layer / File(s) Summary
ScrollViewPropsBase alias and interface inheritance
packages/uniwind/types.d.ts
Aliases ScrollViewProps as ScrollViewPropsBase, updates VirtualizedListWithoutRenderItemProps to extend it, and changes ScrollViewProps to extend ViewProps plus ScrollViewPropsBase.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: removing the Touchable reference from package type definitions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@huntie huntie marked this pull request as ready for review July 2, 2026 16:52
@greptile-apps

greptile-apps Bot commented Jul 2, 2026

Copy link
Copy Markdown

Greptile Summary

This PR removes the Touchable, ScrollViewPropsAndroid, and ScrollViewPropsIOS imports from packages/uniwind/types.d.ts, replacing them with a single ScrollViewProps as ScrollViewPropsBase alias from react-native. This prepares Uniwind for React Native 0.87, where Touchable is expected to be removed from the public TypeScript API.

  • ScrollViewProps augmentation is simplified from extending four separate types (ViewProps, ScrollViewPropsIOS, ScrollViewPropsAndroid, Touchable) to just ViewProps and ScrollViewPropsBase — no type shape changes, since onTouchStart and similar touch handlers are already covered by ViewProps.
  • VirtualizedListWithoutRenderItemProps now extends ScrollViewPropsBase (the aliased import) instead of the previous ScrollViewProps import, which is effectively identical but avoids naming confusion with the augmented interface.

Confidence Score: 5/5

Safe to merge — this is a minimal type-only refactor with no functional changes.

The change is confined to a single .d.ts file and removes three deprecated imports while aliasing a single replacement. The PR description correctly identifies that onTouchStart and related members are already on ViewProps, making the old Touchable extension redundant. All existing props are preserved, and the new base type structurally encompasses everything the old individual bases provided.

No files require special attention.

Important Files Changed

Filename Overview
packages/uniwind/types.d.ts Refactors type augmentations to remove the deprecated Touchable reference and the now-redundant ScrollViewPropsIOS/ScrollViewPropsAndroid imports; replaces them with a single ScrollViewProps as ScrollViewPropsBase import for cleaner base extension.

Reviews (2): Last reviewed commit: "fix: Remove reference to Touchable in pa..." | Re-trigger Greptile

Comment thread packages/uniwind/types.d.ts
@huntie huntie force-pushed the remove-rn-touchable-type branch from f145833 to 341c40b Compare July 3, 2026 12:24
huntie added a commit to huntie/react-native that referenced this pull request Jul 7, 2026
Summary:

**Motivation**

The public type for `Touchable` has zero overlap with its runtime value. This is an internal implementation object which 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 is a **breaking change** with few open source consumers. The `onTouchStart` etc prop typings are part of `ViewProps` today, 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.

- uni-stack/uniwind#592.

Changelog:  
[General][Breaking] - The `Touchable` root export (undocumented) is removed. If you are extending `Touchable` as a type, please use `ViewProps` instead.

Reviewed By: rubennorte

Differential Revision: D110488985
huntie added a commit to huntie/react-native that referenced this pull request Jul 7, 2026
Summary:

**Motivation**

The public type for `Touchable` has zero overlap with its runtime value. This is an internal implementation object which 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 is a **breaking change** with few open source consumers. The `onTouchStart` etc prop typings are part of `ViewProps` today, 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.

- uni-stack/uniwind#592.

Changelog:  
[General][Breaking] - The `Touchable` root export (undocumented) is removed. If you are extending `Touchable` as a type, please use `ViewProps` instead.

Reviewed By: rubennorte

Differential Revision: D110488985
meta-codesync Bot pushed a commit to react/react-native that referenced this pull request Jul 7, 2026
Summary:
Pull Request resolved: #57420

**Motivation**

The public type for `Touchable` has zero overlap with its runtime value. This is an internal implementation object which 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 / #57419.

**Impact**

This is a **breaking change** with few open source consumers. The `onTouchStart` etc prop typings are part of `ViewProps` today, 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.

- uni-stack/uniwind#592.

Changelog:
[General][Breaking] - The `Touchable` root export (undocumented) is removed. If you are extending `Touchable` as a type, please use `ViewProps` instead.

Reviewed By: rubennorte

Differential Revision: D110488985

fbshipit-source-id: 394e3996bb45482723a4b7b18c1cf63f49cb49c5
@Brentlok

Brentlok commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Hey, thanks for PR 🤝

@Brentlok Brentlok merged commit f568fdd into uni-stack:main Jul 7, 2026
3 checks passed
@huntie huntie deleted the remove-rn-touchable-type branch July 8, 2026 09:36
huntie added a commit to huntie/react-native that referenced this pull request Jul 8, 2026
Summary:

NOTE: Resubmission of D110488985.


**Motivation**

The public type for `Touchable` has zero overlap with its runtime value. This is an internal implementation object which 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 is a **breaking change** with few open source consumers. The `onTouchStart` etc prop typings are part of `ViewProps` today, 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.

- uni-stack/uniwind#592.

Changelog:  
[General][Breaking] - The `Touchable` root export (undocumented) is removed. If you are extending `Touchable` as a type, please use `ViewProps` instead.

Reviewed By: rubennorte

Differential Revision: D111022549
huntie added a commit to huntie/react-native that referenced this pull request Jul 8, 2026
Summary:

NOTE: Resubmission of D110488985.


**Motivation**

The public type for `Touchable` has zero overlap with its runtime value. This is an internal implementation object which 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 is a **breaking change** with few open source consumers. The `onTouchStart` etc prop typings are part of `ViewProps` today, 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.

- uni-stack/uniwind#592.

Changelog:  
[General][Breaking] - The `Touchable` root export (undocumented) is removed. If you are extending `Touchable` as a type, please use `ViewProps` instead.

Reviewed By: rubennorte

Differential Revision: D111022549
meta-codesync Bot pushed a commit to react/react-native that referenced this pull request Jul 8, 2026
Summary:
Pull Request resolved: #57476

NOTE: Resubmission of D110488985.

**Motivation**

The public type for `Touchable` has zero overlap with its runtime value. This is an internal implementation object which 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 / #57419.

**Impact**

This is a **breaking change** with few open source consumers. The `onTouchStart` etc prop typings are part of `ViewProps` today, 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.

- uni-stack/uniwind#592.

Changelog:
[General][Breaking] - The `Touchable` root export (undocumented) is removed. If you are extending `Touchable` as a type, please use `ViewProps` instead.

Reviewed By: rubennorte

Differential Revision: D111022549

fbshipit-source-id: bf29ae826d34fb04889b9f56de0f11904fce3f53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants