Skip to content

Conversation

@Saadnajmi
Copy link
Collaborator

Summary:

Cherry-pick a few changes from #2117 aroiund setting wantsUpdateLayer

Test Plan:

RNTester still runs. I still see layer issues with borders and shadows not showing up.. so need to investigate that more.

shwanton and others added 2 commits October 9, 2025 15:30
…tsUpdateLayer

Summary: As title

Test Plan: TBD I believe this is tested after cloning changes to fbsource and then testing there?

Reviewers: shawndempsey, lefever, helenistic

Reviewed By: lefever

Differential Revision: https://phabricator.intern.facebook.com/D53783607

Tasks: T163838856
… for View component

Summary:
This diff fixes an invariant that wasn't valid anymore after having enabled `wantsUpdateLayer` statically for the View component in Fabric.

`RCTUIView` in RCTUIKit enables `wantsUpdateLayer` only if the instance implements the `displayLayer:` method. Because the View component always wants to have `wantsUpdateLayer` enabled, the assumption that `displayLayer:` exists wasn't valid anymore.

This diff only calls the `displayLayer:` method if the instance effectively responds to it. To avoid a perf hit on the check, we only test for it in the initialization and cache the result.

Test Plan:
* Run the Cosmo app
```
~/fbsource/xplat/arfx/cosmo/mac/run.sh
```

| Before | After |
|--|
|  {F1460101180}  |  {F1460101226}  |

Reviewers: shawndempsey, jorgecab, #rn-desktop

Reviewed By: shawndempsey

Differential Revision: https://phabricator.intern.facebook.com/D54090975

# Conflicts:
#	packages/react-native/React/Base/macOS/RCTUIKit.m
@Saadnajmi Saadnajmi requested a review from a team as a code owner October 9, 2025 22:59
@Saadnajmi Saadnajmi merged commit 55213f8 into microsoft:main Oct 10, 2025
21 checks passed
@Saadnajmi Saadnajmi deleted the layer branch October 10, 2025 21:02
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.

3 participants