Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add isChildPublicInstance to ReactNativeTypes (#27788) #41807

Closed
wants to merge 2 commits into from

Conversation

hoxyq
Copy link
Contributor

@hoxyq hoxyq commented Dec 5, 2023

Summary:
Changelog: [Internal]

Follow-up on facebook/react#27783.

React Native is actually using ReactNativeTypes, which are synced from
this repo. In order to make isChildPublicInstance visible for
renderers inside React Native repository, we need to list it in
ReactNativeTypes.

Because of current circular dependency between React Native and React,
it is impossible to actually type it properly:

  • Can't import any types in ReactNativeTypes from local files, because
    it will break React Native, once synced.
  • Implementations can't use real types in their definitions, because it
    will break these checks:

https://github.com/facebook/react/blob/223db40d5a04dc3311f963f5296675f7f43139e8/packages/react-native-renderer/fabric.js#L12-L13

https://github.com/facebook/react/blob/223db40d5a04dc3311f963f5296675f7f43139e8/packages/react-native-renderer/index.js#L12-L14

DiffTrain build for commit facebook/react@c29ca23.

Differential Revision: D51849040

kassens and others added 2 commits December 5, 2023 06:15
Summary:
Changelog: [Internal]

This makes a couple objects more exact. Nothing critical, just noticed
this old branch I had created when doing some Flow upgrades in the past.

DiffTrain build for commit facebook/react@f498aa2.

Reviewed By: hoxyq

Differential Revision: D51824015

Pulled By: hoxyq
Summary:
Changelog: [Internal]

Follow-up on facebook/react#27783.

React Native is actually using `ReactNativeTypes`, which are synced from
this repo. In order to make `isChildPublicInstance` visible for
renderers inside React Native repository, we need to list it in
`ReactNativeTypes`.

Because of current circular dependency between React Native and React,
it is impossible to actually type it properly:
- Can't import any types in `ReactNativeTypes` from local files, because
it will break React Native, once synced.
- Implementations can't use real types in their definitions, because it
will break these checks:

https://github.com/facebook/react/blob/223db40d5a04dc3311f963f5296675f7f43139e8/packages/react-native-renderer/fabric.js#L12-L13

https://github.com/facebook/react/blob/223db40d5a04dc3311f963f5296675f7f43139e8/packages/react-native-renderer/index.js#L12-L14

DiffTrain build for commit facebook/react@c29ca23.

Differential Revision: D51849040
@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner fb-exported labels Dec 5, 2023
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D51849040

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Dec 6, 2023
@facebook-github-bot
Copy link
Contributor

@hoxyq merged this pull request in 616a907.

Othinn pushed a commit to Othinn/react-native that referenced this pull request Jan 9, 2024
…acebook#41807)

Summary:
Pull Request resolved: facebook#41807

Changelog: [Internal]

Follow-up on facebook/react#27783.

React Native is actually using `ReactNativeTypes`, which are synced from
this repo. In order to make `isChildPublicInstance` visible for
renderers inside React Native repository, we need to list it in
`ReactNativeTypes`.

Because of current circular dependency between React Native and React,
it is impossible to actually type it properly:
- Can't import any types in `ReactNativeTypes` from local files, because
it will break React Native, once synced.
- Implementations can't use real types in their definitions, because it
will break these checks:

https://github.com/facebook/react/blob/223db40d5a04dc3311f963f5296675f7f43139e8/packages/react-native-renderer/fabric.js#L12-L13

https://github.com/facebook/react/blob/223db40d5a04dc3311f963f5296675f7f43139e8/packages/react-native-renderer/index.js#L12-L14

DiffTrain build for commit facebook/react@c29ca23.

Test Plan: Sandcastle tests

Reviewed By: kassens

Differential Revision: D51849040

Pulled By: hoxyq

fbshipit-source-id: f75593e44c114289ad4c6fb8b4b37c4c5fd6d3d4
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. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants