SIGN IN SIGN UP
facebook / react-native UNCLAIMED

A framework for building native applications using React

0 0 153 C++

fix(types): expose Modal native ref prop (#56952)

Summary:
- add `modalRef` to the hand-written `Modal` TypeScript declarations
- align the hand-written declaration with existing `React.RefObject` ref prop typing patterns
- add typetest coverage for passing a Modal ref through `modalRef`

This replaces https://github.com/facebook/react-native/issues/56889, which GitHub auto-closed after its pull ref got stuck on a bad force-pushed commit. The branch here contains the same scoped fix plus the review feedback from https://github.com/facebook/react-native/issues/56889.

`Modal` already accepts `modalRef` at runtime and the generated API snapshot already includes it. The hand-written declarations were the odd one out, so TypeScript users could not pass the supported ref prop without a local cast.

## Changelog:

[General] [Fixed] - Expose Modal native ref prop in TypeScript declarations

Pull Request resolved: https://github.com/facebook/react-native/pull/56952

Test Plan:
- `npx prettier --check packages/react-native/Libraries/Modal/Modal.d.ts packages/react-native/types/__typetests__/index.tsx`
- `npm run test-typescript -- --pretty false`
- `npm run build-types`
- `npm run test-generated-typescript -- --pretty false`

Reviewed By: cipolleschi

Differential Revision: D107081018

Pulled By: huntie

fbshipit-source-id: 74a4a6db6d295543557106618b39be6007e1049d
T
threadhoard-vps committed
7cc8c76e838ca3fb9a036ca5af873c48b0762f99
Parent: c789880
Committed by meta-codesync[bot] <215208954+meta-codesync[bot]@users.noreply.github.com> on 6/1/2026, 11:35:56 AM