Skip to content

Conversation

Saadnajmi
Copy link
Collaborator

@Saadnajmi Saadnajmi commented Sep 16, 2025

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.

@Saadnajmi Saadnajmi changed the title feat(fabric): Add macOS host platform feat(fabric): Add macOS host platform to ReactCommon Sep 16, 2025
@Saadnajmi
Copy link
Collaborator Author

Saadnajmi commented Sep 16, 2025

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.

namespace facebook::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 Saadnajmi marked this pull request as ready for review September 17, 2025 00:14
@Saadnajmi Saadnajmi requested a review from a team as a code owner September 17, 2025 00:14
@Saadnajmi Saadnajmi enabled auto-merge (squash) September 18, 2025 02:33
@Saadnajmi Saadnajmi merged commit 9719891 into microsoft:main Sep 18, 2025
39 of 57 checks passed
@Saadnajmi Saadnajmi deleted the host-platform branch September 18, 2025 04:21
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 free to 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