Skip to content

Restrict ref helper return types - #57850

Open
javache wants to merge 1 commit into
react:mainfrom
javache:export-D115064072
Open

Restrict ref helper return types#57850
javache wants to merge 1 commit into
react:mainfrom
javache:export-D115064072

Conversation

@javache

@javache javache commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary:
React ref callbacks may return only void or a cleanup function. Align shared callback-ref contracts with that behavior so consumers cannot hide incompatible returns behind unknown.

Changelog:
[Internal] - Align ref helper types with React's callback contract.

Differential Revision: D115064072

Summary:
React ref callbacks may return only `void` or a cleanup function. Align shared callback-ref contracts with that behavior so consumers cannot hide incompatible returns behind `unknown`.

Changelog:
[Internal] - Align ref helper types with React's callback contract.

Differential Revision: D115064072
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 6, 2026
@facebook-github-tools facebook-github-tools Bot added p: Facebook Partner: Facebook Partner labels Aug 6, 2026
@meta-codesync

meta-codesync Bot commented Aug 6, 2026

Copy link
Copy Markdown

@javache has exported this pull request. If you are a Meta employee, you can view the originating Diff in D115064072.

javache added a commit to javache/react-native that referenced this pull request Aug 7, 2026
Summary:

React ref callbacks may return only `void` or a cleanup function. Align `TRefCallbackFor` and the related shared callback-ref helpers directly with the core Flow React ref types, then update consumers whose callbacks returned incompatible values. This keeps the contracts canonical and avoids introducing a parallel restricted variant.

Changelog:
[Internal] - Align ref helper types with the React callback contract.

Differential Revision: D115064072
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant