Skip to content

Remove accidental ref callback return values (#57849) - #57849

Open
javache wants to merge 2 commits into
react:mainfrom
javache:export-D115064073
Open

Remove accidental ref callback return values (#57849)#57849
javache wants to merge 2 commits into
react:mainfrom
javache:export-D115064073

Conversation

@javache

@javache javache commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary:

Ref callbacks commonly used expression bodies that returned assignment or collection method results. Use block bodies so these callbacks return void, matching React's ref contract.

Changelog:
[Internal] - Make callback refs return void explicitly.

Differential Revision: D115064073

@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 D115064073.

javache added 2 commits August 7, 2026 02:51
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
Summary:

Ref callbacks commonly used expression bodies that returned assignment or collection method results. Use block bodies so these callbacks return `void`, matching React's ref contract.

Changelog:
[Internal] - Make callback refs return `void` explicitly.

Differential Revision: D115064073
@meta-codesync meta-codesync Bot changed the title Remove accidental ref callback return values Remove accidental ref callback return values (#57849) Aug 7, 2026
@javache
javache force-pushed the export-D115064073 branch from 9a22438 to 9e3c9c3 Compare August 7, 2026 09:52
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