Skip to content

Convert KeyboardAvoidingView to function component#57102

Open
ahmdshrif wants to merge 1 commit into
react:mainfrom
ahmdshrif:convert-keyboardavoidingview-fn-comp
Open

Convert KeyboardAvoidingView to function component#57102
ahmdshrif wants to merge 1 commit into
react:mainfrom
ahmdshrif:convert-keyboardavoidingview-fn-comp

Conversation

@ahmdshrif

@ahmdshrif ahmdshrif commented Jun 8, 2026

Copy link
Copy Markdown

Summary:

Converts KeyboardAvoidingView from a class component to a function component, matching the recent conversions of ImageBackground (#56355), RefreshControl (#56354) and Modal (#56348).

Because the component is no longer a class, a ref on <KeyboardAvoidingView> now forwards to the underlying View (so it exposes the View methods like measure, setNativeProps, …) instead of resolving to the KeyboardAvoidingView class instance. KeyboardAvoidingViewInstance is re-typed to the View ref accordingly.

Changelog:

[GENERAL] [CHANGED] - Convert KeyboardAvoidingView to function component

Test Plan:

yarn flow and yarn jest packages/react-native/Libraries/Components/Keyboard pass.

@meta-cla

meta-cla Bot commented Jun 8, 2026

Copy link
Copy Markdown

Hi @ahmdshrif!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

Warning

JavaScript API change detected

This PR commits an update to ReactNativeApi.d.ts, indicating a change to React Native's public JavaScript API.

  • Please include a clear changelog message.
  • This change will be subject to additional review.

This change was flagged as: POTENTIALLY_BREAKING

@ahmdshrif ahmdshrif force-pushed the convert-keyboardavoidingview-fn-comp branch from d4809be to 74a4bef Compare June 8, 2026 08:42
@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 Jun 8, 2026
Follows the same migration as ImageBackground (facebook#56355), RefreshControl
(facebook#56354) and Modal (facebook#56348).

As with ImageBackground, a ref on <KeyboardAvoidingView> now forwards to
the underlying View (exposing measure, setNativeProps, ...) instead of
the class instance; KeyboardAvoidingViewInstance is re-typed to the View
ref accordingly.
@ahmdshrif ahmdshrif force-pushed the convert-keyboardavoidingview-fn-comp branch from 74a4bef to 350fb74 Compare June 8, 2026 08:42
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Jun 8, 2026
@meta-codesync

meta-codesync Bot commented Jun 8, 2026

Copy link
Copy Markdown

@fabriziocucci has imported this pull request. If you are a Meta employee, you can view this in D107854206.

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. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant