Skip to content

Commit fc90f7d

Browse files
rubennortemeta-codesync[bot]
authored andcommitted
Reject deep imports in internal Flow roots
Summary: Reject unsupported `react-native/*` deep imports in consumer Flow roots while retaining explicit mappings for supported secondary and internal compatibility entrypoints. Keep the Jest preset package-internal type imports and the vendored React Native Windows `useMergeRefs` implementation import because package-relative imports across React Native packages are not supported and the latter preserves callback-ref cleanup semantics. Suppress only those intentional package-internal compatibility imports. Changelog: [Internal] Reviewed By: javache Differential Revision: D121377261
1 parent d478604 commit fc90f7d

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

‎packages/jest-preset/jest/mocks/NativeAnimatedHelper.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* @format
99
*/
1010

11+
// $FlowFixMe[cannot-resolve-module]
1112
import typeof TNativeAnimatedHelper from 'react-native/src/private/animated/NativeAnimatedHelper';
1213

1314
const NativeAnimatedHelper = jest.requireActual<{

‎packages/jest-preset/jest/mocks/RendererProxy.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
// In tests, we can use the default version without dependency injection.
1212

13+
// $FlowFixMe[cannot-resolve-module]
1314
import typeof * as TRendererImplementation from 'react-native/Libraries/ReactNative/RendererImplementation';
1415

1516
const {

0 commit comments

Comments
 (0)