Skip to content

Convert Modal to function component#56348

Open
retyui wants to merge 1 commit intofacebook:mainfrom
retyui:modal-as-fn-component
Open

Convert Modal to function component#56348
retyui wants to merge 1 commit intofacebook:mainfrom
retyui:modal-as-fn-component

Conversation

@retyui
Copy link
Copy Markdown
Contributor

@retyui retyui commented Apr 7, 2026

Summary:

As per title.

Changelog:

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

Test Plan:

@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 Apr 7, 2026
@facebook-github-tools facebook-github-tools bot added p: Callstack Partner: Callstack Partner labels Apr 7, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

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

useEffect(() => {
return () => {
setIsRendered(false);
};
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I am not sure if we need it)

but this effect is analog of this part of class component

componentWillUnmount() {
    if (Platform.OS === 'ios') {
      this.setState({isRendered: false});
    }

Modal.displayName = 'Modal';
// $FlowExpectedError[prop-missing]
Wrapper.Context = VirtualizedListContextResetter;
Modal.Context = VirtualizedListContextResetter;
Copy link
Copy Markdown
Contributor Author

@retyui retyui Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this content value was not used in a Wrapper component at all
I'm don't know if we still need this

@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 Apr 7, 2026
@retyui retyui force-pushed the modal-as-fn-component branch from c3d6566 to cda4f05 Compare April 7, 2026 16:09
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. p: Callstack Partner: Callstack Partner 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