From 535ca2be37c11c40e281439f5b6384add8636f2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20Ma=C5=82ecki?= Date: Wed, 15 Jan 2025 02:34:40 -0800 Subject: [PATCH] Replace import syntax in ReactNativeTestTools Summary: Changelog: [Internal] - Replaced React and ReactTestRenderer import syntax in ReactNativeTestTools Differential Revision: D68205425 --- .../react-native/Libraries/Utilities/ReactNativeTestTools.js | 5 +++-- .../__tests__/__snapshots__/public-api-test.js.snap | 4 +--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/react-native/Libraries/Utilities/ReactNativeTestTools.js b/packages/react-native/Libraries/Utilities/ReactNativeTestTools.js index 1d8b4f1bfbafb3..208deddeffcd08 100644 --- a/packages/react-native/Libraries/Utilities/ReactNativeTestTools.js +++ b/packages/react-native/Libraries/Utilities/ReactNativeTestTools.js @@ -14,13 +14,14 @@ import type {ReactTestRenderer as ReactTestRendererType} from 'react-test-render import TouchableWithoutFeedback from '../Components/Touchable/TouchableWithoutFeedback'; +import React from 'react'; +import ReactTestRenderer from 'react-test-renderer'; + const Switch = require('../Components/Switch/Switch').default; const TextInput = require('../Components/TextInput/TextInput'); const View = require('../Components/View/View'); const Text = require('../Text/Text'); const {VirtualizedList} = require('@react-native/virtualized-lists'); -const React = require('react'); -const ReactTestRenderer = require('react-test-renderer'); export type ReactTestInstance = $PropertyType; export type Predicate = (node: ReactTestInstance) => boolean; diff --git a/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap b/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap index 5ff675086e6788..9d544327a97e3d 100644 --- a/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap +++ b/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap @@ -9151,9 +9151,7 @@ declare module.exports: RCTLog; `; exports[`public API should not change unintentionally Libraries/Utilities/ReactNativeTestTools.js 1`] = ` -"declare const React: $FlowFixMe; -declare const ReactTestRenderer: $FlowFixMe; -export type ReactTestInstance = $PropertyType; +"export type ReactTestInstance = $PropertyType; export type Predicate = (node: ReactTestInstance) => boolean; export type ReactTestRendererJSON = ReturnType; declare function byClickable(): Predicate;