From 07d527f9c530dd91e81ef8cf8bb5c0f8b54a951e Mon Sep 17 00:00:00 2001 From: David Vacca Date: Thu, 25 Mar 2021 12:43:56 -0700 Subject: [PATCH] Use unstable_hasStaticViewConfig to detect if a component is registered in the native app Summary: This diff is a revert of the stack D27276533. the native fix will be included as part of another diff changelog: [internal] internal Reviewed By: JoshuaGross, ShikaSD Differential Revision: D27332513 fbshipit-source-id: 203051ea8fec3f508d79c329c9b61399fbbc3d1b --- jest/setup.js | 2 +- packages/rn-tester/js/examples/Snapshot/SnapshotViewIOS.ios.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jest/setup.js b/jest/setup.js index af5e29eff5..1bb9af5c51 100644 --- a/jest/setup.js +++ b/jest/setup.js @@ -70,7 +70,7 @@ jest } }), hasViewManagerConfig: jest.fn(name => { - return name === 'AndroidDrawerLayout'; + return true; }), measure: jest.fn(), manageChildren: jest.fn(), diff --git a/packages/rn-tester/js/examples/Snapshot/SnapshotViewIOS.ios.js b/packages/rn-tester/js/examples/Snapshot/SnapshotViewIOS.ios.js index f466d40b14..89296d7d3d 100644 --- a/packages/rn-tester/js/examples/Snapshot/SnapshotViewIOS.ios.js +++ b/packages/rn-tester/js/examples/Snapshot/SnapshotViewIOS.ios.js @@ -22,7 +22,7 @@ import type {ViewProps} from 'react-native/Libraries/Components/View/ViewPropTyp // Verify that RCTSnapshot is part of the UIManager since it is only loaded // if you have linked against RCTTest like in tests, otherwise we will have // a warning printed out -const RCTSnapshot = UIManager.hasViewManagerConfig('RCTSnapshot') +const RCTSnapshot = UIManager.getViewManagerConfig('RCTSnapshot') ? require('../../../RCTTest/RCTSnapshotNativeComponent') : View;