Skip to content

Conversation

shwanton
Copy link

Please select one of the following

  • I am removing an existing difference between facebook/react-native and microsoft/react-native-macos 👍
  • I am cherry-picking a change from Facebook's react-native into microsoft/react-native-macos 👍
  • I am making a fix / change for the macOS implementation of react-native
  • I am making a change required for Microsoft usage of react-native

Summary

The NativeComponentExample is currently not rendering when building for fabric on iOS.

ref._internalInstanceHandle?.stateNode?.canonical is undefined.
https://github.com/microsoft/react-native-macos/blob/main/packages/rn-tester/NativeComponentExample/js/MyNativeView.js#L38

Upstreamed the latest MyNativeView.js from https://github.com/facebook/react-native/blob/main/packages/rn-tester/NativeComponentExample/js/MyNativeView.js

Changelog

[macOS][Fabric] - Fix NativeComponentExample to render correctly

Test Plan

Before

CleanShot.2023-01-18.at.14.45.05.mp4

After

CleanShot.2023-01-18.at.14.26.00.mp4

@shwanton shwanton marked this pull request as ready for review January 18, 2023 22:49
@shwanton shwanton requested a review from a team as a code owner January 18, 2023 22:49
@Saadnajmi
Copy link
Collaborator

Thanks for the fix! When I had the code looking like this before, it failed the newly added Fabric CI. I'm curious to see if it will pass now :)

@shwanton
Copy link
Author

Oops, this broke Paper on iOS 😓
CleanShot 2023-01-18 at 15 05 34

I'll fix it so that we only render when fabric is available

@Saadnajmi
Copy link
Collaborator

Saadnajmi commented Jan 18, 2023

My understanding is that Turbomodule codegen discovery is somewhat broken at this point in time and the actual paper implementation for RNTMyNativeView isn't getting linked :/.

I'm hoping this will be resolved after we sync to 0.71

@shwanton
Copy link
Author

Found a temporary fix that won't throw error when trying to render on Paper.

Paper
CleanShot 2023-01-19 at 00 08 47

Fabric
CleanShot 2023-01-19 at 00 02 02

@Saadnajmi Saadnajmi merged commit b63d52f into microsoft:main Jan 19, 2023
@shwanton shwanton deleted the fabric/fix-native-component branch January 20, 2023 02:25
shwanton added a commit to shwanton/react-native-macos that referenced this pull request Feb 13, 2023
…t#1662)

* Fix NativeComponentExample not rendering on Fabric

* Add back fabric check and conditionally render the example

* Update macOS  tags & re-add comment

Co-authored-by: Shawn Dempsey <shawndempsey@fb.com>
shwanton added a commit to shwanton/react-native-macos that referenced this pull request Mar 10, 2023
…t#1662)

* Fix NativeComponentExample not rendering on Fabric

* Add back fabric check and conditionally render the example

* Update macOS  tags & re-add comment

Co-authored-by: Shawn Dempsey <shawndempsey@fb.com>
shwanton added a commit to shwanton/react-native-macos that referenced this pull request Mar 10, 2023
…t#1662)

* Fix NativeComponentExample not rendering on Fabric

* Add back fabric check and conditionally render the example

* Update macOS  tags & re-add comment

Co-authored-by: Shawn Dempsey <shawndempsey@fb.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants