Skip to content

Commit 88fb470

Browse files
authored
Skip UIManager constants lookup on react-native-windows (#4591)
## Description On `react-native-windows` with the new architecture, `UIManager.getViewManagerConfig('getConstants')` in `createHandler.tsx` logs a soft error from RN's `BridgelessUIManager`, because RNW does not install the legacy UIManager constants binding. The error is raised while the bundle is being evaluated, and RNW treats it as an instance error, which leaves Release builds with a blank screen. This PR skips the lookup on Windows. The lookup is a Paper-only mechanism and never returned anything there, so nothing changes for the other platforms. Fixes #4587 ## Test plan Reporter verified the same change via patch-package on RNW 0.84 / RNGH 2.33.0, Release MSIX.
1 parent 08f030f commit 88fb470

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎packages/react-native-gesture-handler/src/handlers/createHandler.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ UIManagerAny.genericDirectEventTypes = {
7878
...customGHEventsConfig,
7979
};
8080

81-
const UIManagerConstants = UIManagerAny.getViewManagerConfig?.('getConstants');
81+
const UIManagerConstants =
82+
Platform.OS === 'windows'
83+
? null
84+
: UIManagerAny.getViewManagerConfig?.('getConstants');
8285

8386
if (UIManagerConstants) {
8487
UIManagerConstants.genericDirectEventTypes = {

0 commit comments

Comments
 (0)