Skip to content

feat(fabric): Add macOS host platform to ReactCommon - #2690

Merged
Saad Najmi (Saadnajmi) merged 7 commits into
microsoft:mainfrom
Saadnajmi:host-platform
Sep 18, 2025
Merged

feat(fabric): Add macOS host platform to ReactCommon#2690
Saad Najmi (Saadnajmi) merged 7 commits into
microsoft:mainfrom
Saadnajmi:host-platform

Conversation

@Saadnajmi

@SaadnajmiSaad Najmi (Saadnajmi) commented Sep 16, 2025

Copy link
Copy Markdown
Collaborator

Summary:

Add a new macOS host platform folder, with overrides for some of the HostPlatform* files to implement some macOS only props. This follows the pattern in React Native Core that Android uses, and what React Native Windows does.

Some notes:

  • I also needed to fix a casting issue in RCTPullToRefreshViewComponentView.mm. This is later fixed upstream so we can remove the diff then.
  • These new props are not implemented on the component (RCTViewComponentView yet, that will be in a future PR)

Test Plan:

CI should pass.

@SaadnajmiSaad Najmi (Saadnajmi) changed the title feat(fabric): Add macOS host platformfeat(fabric): Add macOS host platform to ReactCommonSep 16, 2025
@Saadnajmi

Saad Najmi (Saadnajmi) commented Sep 16, 2025

Copy link
Copy Markdown
CollaboratorAuthor

Another Q: Should we exclude the cxx platform files from our build?
AKA stuff like: `packages/react-native/ReactCommon/react/renderer/components/view/platform/cxx/react/renderer/components/view/HostPlatformTouch.h

They're all files that most just namespace the base class, so they're safe to compile.

namespacefacebook::react {
using HostPlatformFoo= BaseFoo;
} // namespace facebook::react

The annoying part is they both show up in Xcode and it's hard to tell which one you want to edit. The counterargument would be that we would have different files included in our build for iOS vs macOS which might make building more annoying

@Saadnajmi
Saad Najmi (Saadnajmi) merged commit 9719891 into microsoft:mainSep 18, 2025
39 of 57 checks passed
@Saadnajmi
Saad Najmi (Saadnajmi) deleted the host-platform branch September 18, 2025 04:21
Saad Najmi (Saadnajmi) added a commit that referenced this pull request Sep 19, 2025
Needs #2690 to land first.
## Summary:
Implement focus on RCTViewComponentView. Much of the implementation is
taken from #1437, #2117 and comparing against `RCTView`. The border path
used for `drawFocusRingMask` is the same as what is used for box shadows
and cursors.
## Test Plan:
The focus loop seems nonexistent on both paper and Fabric in RNTester...
but I can verify that calling `ref.current?/.focus()` on a Pressable
displays the focus ring
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@Saadnajmi@acoates-ms