diff --git a/Libraries/ActionSheetIOS/ActionSheetIOS.js b/Libraries/ActionSheetIOS/ActionSheetIOS.js index 0904d14024f..c9aaca1e3ad 100644 --- a/Libraries/ActionSheetIOS/ActionSheetIOS.js +++ b/Libraries/ActionSheetIOS/ActionSheetIOS.js @@ -8,12 +8,13 @@ * @format */ +import type {ProcessedColorValue} from '../StyleSheet/processColor'; +import type {ColorValue} from '../StyleSheet/StyleSheet'; + import RCTActionSheetManager from './NativeActionSheetManager'; -const invariant = require('invariant'); const processColor = require('../StyleSheet/processColor'); -import type {ColorValue} from '../StyleSheet/StyleSheet'; -import type {ProcessedColorValue} from '../StyleSheet/processColor'; +const invariant = require('invariant'); /** * Display action sheets and share sheets on iOS. diff --git a/Libraries/ActionSheetIOS/NativeActionSheetManager.js b/Libraries/ActionSheetIOS/NativeActionSheetManager.js index 1f9ead0bdd8..8247ac260af 100644 --- a/Libraries/ActionSheetIOS/NativeActionSheetManager.js +++ b/Libraries/ActionSheetIOS/NativeActionSheetManager.js @@ -9,6 +9,7 @@ */ import type {TurboModule} from '../TurboModule/RCTExport'; + import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry'; export interface Spec extends TurboModule { diff --git a/Libraries/Alert/NativeAlertManager.js b/Libraries/Alert/NativeAlertManager.js index 65d815ec796..7f7b1cf6a9b 100644 --- a/Libraries/Alert/NativeAlertManager.js +++ b/Libraries/Alert/NativeAlertManager.js @@ -9,6 +9,7 @@ */ import type {TurboModule} from '../TurboModule/RCTExport'; + import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry'; export type Args = {| diff --git a/Libraries/Alert/RCTAlertManager.ios.js b/Libraries/Alert/RCTAlertManager.ios.js index 01f055da53d..d4e9eab97ff 100644 --- a/Libraries/Alert/RCTAlertManager.ios.js +++ b/Libraries/Alert/RCTAlertManager.ios.js @@ -8,9 +8,10 @@ * @flow strict-local */ -import NativeAlertManager from './NativeAlertManager'; import type {Args} from './NativeAlertManager'; +import NativeAlertManager from './NativeAlertManager'; + module.exports = { alertWithArgs( args: Args, diff --git a/Libraries/Animated/Animated.js b/Libraries/Animated/Animated.js index 4b2de95d3f1..ec17ef76454 100644 --- a/Libraries/Animated/Animated.js +++ b/Libraries/Animated/Animated.js @@ -10,7 +10,6 @@ export type {CompositeAnimation, Numeric} from './AnimatedImplementation'; -import Platform from '../Utilities/Platform'; import typeof AnimatedFlatList from './components/AnimatedFlatList'; import typeof AnimatedImage from './components/AnimatedImage'; import typeof AnimatedScrollView from './components/AnimatedScrollView'; @@ -18,8 +17,9 @@ import typeof AnimatedSectionList from './components/AnimatedSectionList'; import typeof AnimatedText from './components/AnimatedText'; import typeof AnimatedView from './components/AnimatedView'; -import AnimatedMock from './AnimatedMock'; +import Platform from '../Utilities/Platform'; import AnimatedImplementation from './AnimatedImplementation'; +import AnimatedMock from './AnimatedMock'; const Animated = ((Platform.isTesting ? AnimatedMock diff --git a/Libraries/Animated/AnimatedEvent.js b/Libraries/Animated/AnimatedEvent.js index bdbbb837a86..7279c2af4de 100644 --- a/Libraries/Animated/AnimatedEvent.js +++ b/Libraries/Animated/AnimatedEvent.js @@ -10,15 +10,14 @@ 'use strict'; +import type {PlatformConfig} from './AnimatedPlatformConfig'; + +import {findNodeHandle} from '../ReactNative/RendererProxy'; +import NativeAnimatedHelper from './NativeAnimatedHelper'; import AnimatedValue from './nodes/AnimatedValue'; import AnimatedValueXY from './nodes/AnimatedValueXY'; -import NativeAnimatedHelper from './NativeAnimatedHelper'; -import {findNodeHandle} from '../ReactNative/RendererProxy'; - import invariant from 'invariant'; -import type {PlatformConfig} from './AnimatedPlatformConfig'; - export type Mapping = | {[key: string]: Mapping, ...} | AnimatedValue diff --git a/Libraries/Animated/AnimatedImplementation.js b/Libraries/Animated/AnimatedImplementation.js index 33883c9494e..b72c7e359fb 100644 --- a/Libraries/Animated/AnimatedImplementation.js +++ b/Libraries/Animated/AnimatedImplementation.js @@ -10,8 +10,23 @@ 'use strict'; +import type {EventConfig, Mapping} from './AnimatedEvent'; +import type { + AnimationConfig, + EndCallback, + EndResult, +} from './animations/Animation'; +import type {DecayAnimationConfig} from './animations/DecayAnimation'; +import type {SpringAnimationConfig} from './animations/SpringAnimation'; +import type {TimingAnimationConfig} from './animations/TimingAnimation'; + import {AnimatedEvent, attachNativeEvent} from './AnimatedEvent'; +import DecayAnimation from './animations/DecayAnimation'; +import SpringAnimation from './animations/SpringAnimation'; +import TimingAnimation from './animations/TimingAnimation'; +import createAnimatedComponent from './createAnimatedComponent'; import AnimatedAddition from './nodes/AnimatedAddition'; +import AnimatedColor from './nodes/AnimatedColor'; import AnimatedDiffClamp from './nodes/AnimatedDiffClamp'; import AnimatedDivision from './nodes/AnimatedDivision'; import AnimatedInterpolation from './nodes/AnimatedInterpolation'; @@ -22,23 +37,6 @@ import AnimatedSubtraction from './nodes/AnimatedSubtraction'; import AnimatedTracking from './nodes/AnimatedTracking'; import AnimatedValue from './nodes/AnimatedValue'; import AnimatedValueXY from './nodes/AnimatedValueXY'; -import DecayAnimation from './animations/DecayAnimation'; -import SpringAnimation from './animations/SpringAnimation'; -import TimingAnimation from './animations/TimingAnimation'; - -import createAnimatedComponent from './createAnimatedComponent'; - -import type { - AnimationConfig, - EndCallback, - EndResult, -} from './animations/Animation'; -import type {TimingAnimationConfig} from './animations/TimingAnimation'; -import type {DecayAnimationConfig} from './animations/DecayAnimation'; -import type {SpringAnimationConfig} from './animations/SpringAnimation'; -import type {Mapping, EventConfig} from './AnimatedEvent'; - -import AnimatedColor from './nodes/AnimatedColor'; export type CompositeAnimation = { start: (callback?: ?EndCallback) => void, diff --git a/Libraries/Animated/AnimatedMock.js b/Libraries/Animated/AnimatedMock.js index 28cc94bb486..c509c830f7d 100644 --- a/Libraries/Animated/AnimatedMock.js +++ b/Libraries/Animated/AnimatedMock.js @@ -10,24 +10,22 @@ 'use strict'; +import type {Numeric as AnimatedNumeric} from './AnimatedImplementation'; import type {EndResult} from './animations/Animation'; +import type {EndCallback} from './animations/Animation'; +import type {DecayAnimationConfig} from './animations/DecayAnimation'; +import type {SpringAnimationConfig} from './animations/SpringAnimation'; +import type {TimingAnimationConfig} from './animations/TimingAnimation'; import {AnimatedEvent, attachNativeEvent} from './AnimatedEvent'; import AnimatedImplementation from './AnimatedImplementation'; +import createAnimatedComponent from './createAnimatedComponent'; +import AnimatedColor from './nodes/AnimatedColor'; import AnimatedInterpolation from './nodes/AnimatedInterpolation'; import AnimatedNode from './nodes/AnimatedNode'; import AnimatedValue from './nodes/AnimatedValue'; import AnimatedValueXY from './nodes/AnimatedValueXY'; -import createAnimatedComponent from './createAnimatedComponent'; - -import type {EndCallback} from './animations/Animation'; -import type {TimingAnimationConfig} from './animations/TimingAnimation'; -import type {DecayAnimationConfig} from './animations/DecayAnimation'; -import type {SpringAnimationConfig} from './animations/SpringAnimation'; -import type {Numeric as AnimatedNumeric} from './AnimatedImplementation'; -import AnimatedColor from './nodes/AnimatedColor'; - /** * Animations are a source of flakiness in snapshot testing. This mock replaces * animation functions from AnimatedImplementation with empty animations for diff --git a/Libraries/Animated/NativeAnimatedHelper.js b/Libraries/Animated/NativeAnimatedHelper.js index 811d5b998a8..08145f645b3 100644 --- a/Libraries/Animated/NativeAnimatedHelper.js +++ b/Libraries/Animated/NativeAnimatedHelper.js @@ -8,22 +8,23 @@ * @format */ -import NativeAnimatedNonTurboModule from './NativeAnimatedModule'; -import NativeAnimatedTurboModule from './NativeAnimatedTurboModule'; -import NativeEventEmitter from '../EventEmitter/NativeEventEmitter'; -import Platform from '../Utilities/Platform'; +import type {EventSubscription} from '../vendor/emitter/EventEmitter'; import type {EventConfig} from './AnimatedEvent'; +import type {AnimationConfig, EndCallback} from './animations/Animation'; import type { - EventMapping, AnimatedNodeConfig, AnimatingNodeConfig, + EventMapping, } from './NativeAnimatedModule'; -import type {AnimationConfig, EndCallback} from './animations/Animation'; import type {InterpolationConfigType} from './nodes/AnimatedInterpolation'; -import ReactNativeFeatureFlags from '../ReactNative/ReactNativeFeatureFlags'; -import invariant from 'invariant'; + +import NativeEventEmitter from '../EventEmitter/NativeEventEmitter'; import RCTDeviceEventEmitter from '../EventEmitter/RCTDeviceEventEmitter'; -import type {EventSubscription} from '../vendor/emitter/EventEmitter'; +import ReactNativeFeatureFlags from '../ReactNative/ReactNativeFeatureFlags'; +import Platform from '../Utilities/Platform'; +import NativeAnimatedNonTurboModule from './NativeAnimatedModule'; +import NativeAnimatedTurboModule from './NativeAnimatedTurboModule'; +import invariant from 'invariant'; // TODO T69437152 @petetheheat - Delete this fork when Fabric ships to 100%. const NativeAnimatedModule = diff --git a/Libraries/Animated/NativeAnimatedModule.js b/Libraries/Animated/NativeAnimatedModule.js index 73f3bb76f90..9fc932e6b50 100644 --- a/Libraries/Animated/NativeAnimatedModule.js +++ b/Libraries/Animated/NativeAnimatedModule.js @@ -9,6 +9,7 @@ */ import type {TurboModule} from '../TurboModule/RCTExport'; + import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry'; type EndResult = {finished: boolean, ...}; diff --git a/Libraries/Animated/NativeAnimatedTurboModule.js b/Libraries/Animated/NativeAnimatedTurboModule.js index 3adac4237da..58664ca8742 100644 --- a/Libraries/Animated/NativeAnimatedTurboModule.js +++ b/Libraries/Animated/NativeAnimatedTurboModule.js @@ -9,6 +9,7 @@ */ import type {TurboModule} from '../TurboModule/RCTExport'; + import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry'; type EndResult = {finished: boolean, ...}; diff --git a/Libraries/Animated/__tests__/Animated-test.js b/Libraries/Animated/__tests__/Animated-test.js index 5b13e40b811..f51acd818c3 100644 --- a/Libraries/Animated/__tests__/Animated-test.js +++ b/Libraries/Animated/__tests__/Animated-test.js @@ -8,8 +8,11 @@ * @oncall react_native */ -import TestRenderer from 'react-test-renderer'; import * as React from 'react'; +import TestRenderer from 'react-test-renderer'; + +let Animated = require('../Animated').default; +let AnimatedProps = require('../nodes/AnimatedProps').default; jest.mock('../../BatchedBridge/NativeModules', () => ({ NativeAnimatedModule: {}, @@ -20,9 +23,6 @@ jest.mock('../../BatchedBridge/NativeModules', () => ({ }, })); -let AnimatedProps = require('../nodes/AnimatedProps').default; -let Animated = require('../Animated').default; - describe('Animated tests', () => { beforeEach(() => { jest.resetModules(); diff --git a/Libraries/Animated/__tests__/AnimatedMock-test.js b/Libraries/Animated/__tests__/AnimatedMock-test.js index 107fa50919a..d08a5ecc38f 100644 --- a/Libraries/Animated/__tests__/AnimatedMock-test.js +++ b/Libraries/Animated/__tests__/AnimatedMock-test.js @@ -10,8 +10,8 @@ 'use strict'; -import AnimatedMock from '../AnimatedMock'; import AnimatedImplementation from '../AnimatedImplementation'; +import AnimatedMock from '../AnimatedMock'; describe('Animated Mock', () => { it('matches implementation keys', () => { diff --git a/Libraries/Animated/__tests__/AnimatedNative-test.js b/Libraries/Animated/__tests__/AnimatedNative-test.js index b333c17fadf..2f7b10af052 100644 --- a/Libraries/Animated/__tests__/AnimatedNative-test.js +++ b/Libraries/Animated/__tests__/AnimatedNative-test.js @@ -23,8 +23,8 @@ jest // findNodeHandle is imported from RendererProxy so mock that whole module. .setMock('../../ReactNative/RendererProxy', {findNodeHandle: () => 1}); -import TestRenderer from 'react-test-renderer'; import * as React from 'react'; +import TestRenderer from 'react-test-renderer'; const Animated = require('../Animated').default; const NativeAnimatedHelper = require('../NativeAnimatedHelper').default; diff --git a/Libraries/Animated/__tests__/Interpolation-test.js b/Libraries/Animated/__tests__/Interpolation-test.js index 21d796ed6d6..2893cdd3939 100644 --- a/Libraries/Animated/__tests__/Interpolation-test.js +++ b/Libraries/Animated/__tests__/Interpolation-test.js @@ -10,8 +10,8 @@ 'use strict'; -import AnimatedInterpolation from '../nodes/AnimatedInterpolation'; import Easing from '../Easing'; +import AnimatedInterpolation from '../nodes/AnimatedInterpolation'; describe('Interpolation', () => { it('should work with defaults', () => { diff --git a/Libraries/Animated/__tests__/createAnimatedComponentInjection-test.js b/Libraries/Animated/__tests__/createAnimatedComponentInjection-test.js index e2388fcd26c..15936f7b675 100644 --- a/Libraries/Animated/__tests__/createAnimatedComponentInjection-test.js +++ b/Libraries/Animated/__tests__/createAnimatedComponentInjection-test.js @@ -11,9 +11,10 @@ 'use strict'; +import * as React from 'react'; + const createAnimatedComponent = require('../createAnimatedComponent').default; const createAnimatedComponentInjection = require('../createAnimatedComponentInjection'); -import * as React from 'react'; function injected( Component: React.AbstractComponent, diff --git a/Libraries/Animated/animations/Animation.js b/Libraries/Animated/animations/Animation.js index 68d04566a97..f3d2ac6d3ac 100644 --- a/Libraries/Animated/animations/Animation.js +++ b/Libraries/Animated/animations/Animation.js @@ -10,10 +10,11 @@ 'use strict'; -import NativeAnimatedHelper from '../NativeAnimatedHelper'; import type {PlatformConfig} from '../AnimatedPlatformConfig'; import type AnimatedValue from '../nodes/AnimatedValue'; +import NativeAnimatedHelper from '../NativeAnimatedHelper'; + export type EndResult = {finished: boolean, ...}; export type EndCallback = (result: EndResult) => void; diff --git a/Libraries/Animated/animations/DecayAnimation.js b/Libraries/Animated/animations/DecayAnimation.js index d365cd726f5..f0042c5881d 100644 --- a/Libraries/Animated/animations/DecayAnimation.js +++ b/Libraries/Animated/animations/DecayAnimation.js @@ -10,14 +10,13 @@ 'use strict'; -import Animation from './Animation'; - -import NativeAnimatedHelper from '../NativeAnimatedHelper'; - import type {PlatformConfig} from '../AnimatedPlatformConfig'; import type AnimatedValue from '../nodes/AnimatedValue'; import type {AnimationConfig, EndCallback} from './Animation'; +import NativeAnimatedHelper from '../NativeAnimatedHelper'; +import Animation from './Animation'; + export type DecayAnimationConfig = { ...AnimationConfig, velocity: diff --git a/Libraries/Animated/animations/SpringAnimation.js b/Libraries/Animated/animations/SpringAnimation.js index 1c0d919b67c..69101dab030 100644 --- a/Libraries/Animated/animations/SpringAnimation.js +++ b/Libraries/Animated/animations/SpringAnimation.js @@ -10,21 +10,17 @@ 'use strict'; +import type {PlatformConfig} from '../AnimatedPlatformConfig'; +import type AnimatedInterpolation from '../nodes/AnimatedInterpolation'; import type AnimatedValue from '../nodes/AnimatedValue'; import type AnimatedValueXY from '../nodes/AnimatedValueXY'; -import type AnimatedInterpolation from '../nodes/AnimatedInterpolation'; - -import Animation from './Animation'; -import * as SpringConfig from '../SpringConfig'; - -import invariant from 'invariant'; - -import NativeAnimatedHelper from '../NativeAnimatedHelper'; - -import type {PlatformConfig} from '../AnimatedPlatformConfig'; import type {AnimationConfig, EndCallback} from './Animation'; +import NativeAnimatedHelper from '../NativeAnimatedHelper'; import AnimatedColor from '../nodes/AnimatedColor'; +import * as SpringConfig from '../SpringConfig'; +import Animation from './Animation'; +import invariant from 'invariant'; export type SpringAnimationConfig = { ...AnimationConfig, diff --git a/Libraries/Animated/animations/TimingAnimation.js b/Libraries/Animated/animations/TimingAnimation.js index 5262b970386..5c0c3ce3814 100644 --- a/Libraries/Animated/animations/TimingAnimation.js +++ b/Libraries/Animated/animations/TimingAnimation.js @@ -10,19 +10,16 @@ 'use strict'; +import type {PlatformConfig} from '../AnimatedPlatformConfig'; +import type {RgbaValue} from '../nodes/AnimatedColor'; +import type AnimatedInterpolation from '../nodes/AnimatedInterpolation'; import type AnimatedValue from '../nodes/AnimatedValue'; import type AnimatedValueXY from '../nodes/AnimatedValueXY'; -import type AnimatedInterpolation from '../nodes/AnimatedInterpolation'; - -import Animation from './Animation'; +import type {AnimationConfig, EndCallback} from './Animation'; import NativeAnimatedHelper from '../NativeAnimatedHelper'; - -import type {PlatformConfig} from '../AnimatedPlatformConfig'; -import type {AnimationConfig, EndCallback} from './Animation'; -import type {RgbaValue} from '../nodes/AnimatedColor'; - import AnimatedColor from '../nodes/AnimatedColor'; +import Animation from './Animation'; export type TimingAnimationConfig = $ReadOnly<{ ...AnimationConfig, diff --git a/Libraries/Animated/components/AnimatedFlatList.js b/Libraries/Animated/components/AnimatedFlatList.js index 966f6b272c0..afe8bd88061 100644 --- a/Libraries/Animated/components/AnimatedFlatList.js +++ b/Libraries/Animated/components/AnimatedFlatList.js @@ -8,12 +8,11 @@ * @format */ -import * as React from 'react'; +import type {AnimatedComponentType} from '../createAnimatedComponent'; import FlatList from '../../Lists/FlatList'; import createAnimatedComponent from '../createAnimatedComponent'; - -import type {AnimatedComponentType} from '../createAnimatedComponent'; +import * as React from 'react'; /** * @see https://github.com/facebook/react-native/commit/b8c8562 diff --git a/Libraries/Animated/components/AnimatedImage.js b/Libraries/Animated/components/AnimatedImage.js index 823f6bcdbc8..c178480fe73 100644 --- a/Libraries/Animated/components/AnimatedImage.js +++ b/Libraries/Animated/components/AnimatedImage.js @@ -8,12 +8,11 @@ * @format */ -import * as React from 'react'; +import type {AnimatedComponentType} from '../createAnimatedComponent'; import Image from '../../Image/Image'; import createAnimatedComponent from '../createAnimatedComponent'; - -import type {AnimatedComponentType} from '../createAnimatedComponent'; +import * as React from 'react'; export default (createAnimatedComponent( (Image: $FlowFixMe), diff --git a/Libraries/Animated/components/AnimatedScrollView.js b/Libraries/Animated/components/AnimatedScrollView.js index df2dbccd2ad..5b25a716430 100644 --- a/Libraries/Animated/components/AnimatedScrollView.js +++ b/Libraries/Animated/components/AnimatedScrollView.js @@ -8,20 +8,19 @@ * @format */ -import * as React from 'react'; -import {useMemo} from 'react'; +import type {AnimatedComponentType} from '../createAnimatedComponent'; import RefreshControl from '../../Components/RefreshControl/RefreshControl'; import ScrollView from '../../Components/ScrollView/ScrollView'; -import StyleSheet from '../../StyleSheet/StyleSheet'; import flattenStyle from '../../StyleSheet/flattenStyle'; import splitLayoutProps from '../../StyleSheet/splitLayoutProps'; +import StyleSheet from '../../StyleSheet/StyleSheet'; import Platform from '../../Utilities/Platform'; import useMergeRefs from '../../Utilities/useMergeRefs'; import createAnimatedComponent from '../createAnimatedComponent'; import useAnimatedProps from '../useAnimatedProps'; - -import type {AnimatedComponentType} from '../createAnimatedComponent'; +import * as React from 'react'; +import {useMemo} from 'react'; type Props = React.ElementConfig; type Instance = React.ElementRef; diff --git a/Libraries/Animated/components/AnimatedSectionList.js b/Libraries/Animated/components/AnimatedSectionList.js index e5dd4c6613a..955691f6e2b 100644 --- a/Libraries/Animated/components/AnimatedSectionList.js +++ b/Libraries/Animated/components/AnimatedSectionList.js @@ -8,12 +8,11 @@ * @format */ -import * as React from 'react'; +import type {AnimatedComponentType} from '../createAnimatedComponent'; import SectionList from '../../Lists/SectionList'; import createAnimatedComponent from '../createAnimatedComponent'; - -import type {AnimatedComponentType} from '../createAnimatedComponent'; +import * as React from 'react'; /** * @see https://github.com/facebook/react-native/commit/b8c8562 diff --git a/Libraries/Animated/components/AnimatedText.js b/Libraries/Animated/components/AnimatedText.js index 6329932413d..02679f1a801 100644 --- a/Libraries/Animated/components/AnimatedText.js +++ b/Libraries/Animated/components/AnimatedText.js @@ -8,12 +8,11 @@ * @format */ -import * as React from 'react'; +import type {AnimatedComponentType} from '../createAnimatedComponent'; import Text from '../../Text/Text'; import createAnimatedComponent from '../createAnimatedComponent'; - -import type {AnimatedComponentType} from '../createAnimatedComponent'; +import * as React from 'react'; export default (createAnimatedComponent( (Text: $FlowFixMe), diff --git a/Libraries/Animated/components/AnimatedView.js b/Libraries/Animated/components/AnimatedView.js index da01bc17e07..5eca94417e6 100644 --- a/Libraries/Animated/components/AnimatedView.js +++ b/Libraries/Animated/components/AnimatedView.js @@ -8,12 +8,11 @@ * @format */ -import * as React from 'react'; +import type {AnimatedComponentType} from '../createAnimatedComponent'; import View from '../../Components/View/View'; import createAnimatedComponent from '../createAnimatedComponent'; - -import type {AnimatedComponentType} from '../createAnimatedComponent'; +import * as React from 'react'; export default (createAnimatedComponent(View): AnimatedComponentType< React.ElementConfig, diff --git a/Libraries/Animated/createAnimatedComponent.js b/Libraries/Animated/createAnimatedComponent.js index ec815279266..7889b0de085 100644 --- a/Libraries/Animated/createAnimatedComponent.js +++ b/Libraries/Animated/createAnimatedComponent.js @@ -10,16 +10,14 @@ 'use strict'; -import * as createAnimatedComponentInjection from './createAnimatedComponentInjection'; - import View from '../Components/View/View'; -import {AnimatedEvent} from './AnimatedEvent'; -import AnimatedProps from './nodes/AnimatedProps'; -import * as React from 'react'; -import NativeAnimatedHelper from './NativeAnimatedHelper'; - -import invariant from 'invariant'; import setAndForwardRef from '../Utilities/setAndForwardRef'; +import {AnimatedEvent} from './AnimatedEvent'; +import * as createAnimatedComponentInjection from './createAnimatedComponentInjection'; +import NativeAnimatedHelper from './NativeAnimatedHelper'; +import AnimatedProps from './nodes/AnimatedProps'; +import invariant from 'invariant'; +import * as React from 'react'; let animatedComponentNextId = 1; diff --git a/Libraries/Animated/createAnimatedComponent_EXPERIMENTAL.js b/Libraries/Animated/createAnimatedComponent_EXPERIMENTAL.js index b2cd04ac56e..eb7c78cecc8 100644 --- a/Libraries/Animated/createAnimatedComponent_EXPERIMENTAL.js +++ b/Libraries/Animated/createAnimatedComponent_EXPERIMENTAL.js @@ -8,9 +8,9 @@ * @format */ -import useAnimatedProps from './useAnimatedProps'; -import useMergeRefs from '../Utilities/useMergeRefs'; import StyleSheet from '../StyleSheet/StyleSheet'; +import useMergeRefs from '../Utilities/useMergeRefs'; +import useAnimatedProps from './useAnimatedProps'; import * as React from 'react'; /** diff --git a/Libraries/Animated/nodes/AnimatedAddition.js b/Libraries/Animated/nodes/AnimatedAddition.js index c5e35fce04e..7a48965f5dd 100644 --- a/Libraries/Animated/nodes/AnimatedAddition.js +++ b/Libraries/Animated/nodes/AnimatedAddition.js @@ -10,15 +10,14 @@ 'use strict'; +import type {PlatformConfig} from '../AnimatedPlatformConfig'; +import type {InterpolationConfigType} from './AnimatedInterpolation'; import type AnimatedNode from './AnimatedNode'; import AnimatedInterpolation from './AnimatedInterpolation'; import AnimatedValue from './AnimatedValue'; import AnimatedWithChildren from './AnimatedWithChildren'; -import type {PlatformConfig} from '../AnimatedPlatformConfig'; -import type {InterpolationConfigType} from './AnimatedInterpolation'; - export default class AnimatedAddition extends AnimatedWithChildren { _a: AnimatedNode; _b: AnimatedNode; diff --git a/Libraries/Animated/nodes/AnimatedColor.js b/Libraries/Animated/nodes/AnimatedColor.js index 16a87f52800..d6fba11337f 100644 --- a/Libraries/Animated/nodes/AnimatedColor.js +++ b/Libraries/Animated/nodes/AnimatedColor.js @@ -10,16 +10,16 @@ 'use strict'; -import AnimatedValue from './AnimatedValue'; -import AnimatedWithChildren from './AnimatedWithChildren'; +import type {NativeColorValue} from '../../StyleSheet/PlatformColorValueTypes'; +import type {ProcessedColorValue} from '../../StyleSheet/processColor'; +import type {ColorValue} from '../../StyleSheet/StyleSheet'; +import type {PlatformConfig} from '../AnimatedPlatformConfig'; + import normalizeColor from '../../StyleSheet/normalizeColor'; import {processColorObject} from '../../StyleSheet/PlatformColorValueTypes'; import NativeAnimatedHelper from '../NativeAnimatedHelper'; - -import type {PlatformConfig} from '../AnimatedPlatformConfig'; -import type {ColorValue} from '../../StyleSheet/StyleSheet'; -import type {NativeColorValue} from '../../StyleSheet/PlatformColorValueTypes'; -import type {ProcessedColorValue} from '../../StyleSheet/processColor'; +import AnimatedValue from './AnimatedValue'; +import AnimatedWithChildren from './AnimatedWithChildren'; export type AnimatedColorConfig = $ReadOnly<{ useNativeDriver: boolean, diff --git a/Libraries/Animated/nodes/AnimatedDiffClamp.js b/Libraries/Animated/nodes/AnimatedDiffClamp.js index c543e8069f9..d2ac11ae764 100644 --- a/Libraries/Animated/nodes/AnimatedDiffClamp.js +++ b/Libraries/Animated/nodes/AnimatedDiffClamp.js @@ -10,14 +10,13 @@ 'use strict'; +import type {PlatformConfig} from '../AnimatedPlatformConfig'; +import type {InterpolationConfigType} from './AnimatedInterpolation'; import type AnimatedNode from './AnimatedNode'; import AnimatedInterpolation from './AnimatedInterpolation'; import AnimatedWithChildren from './AnimatedWithChildren'; -import type {InterpolationConfigType} from './AnimatedInterpolation'; -import type {PlatformConfig} from '../AnimatedPlatformConfig'; - export default class AnimatedDiffClamp extends AnimatedWithChildren { _a: AnimatedNode; _min: number; diff --git a/Libraries/Animated/nodes/AnimatedDivision.js b/Libraries/Animated/nodes/AnimatedDivision.js index ee5e768d344..158a0f3d780 100644 --- a/Libraries/Animated/nodes/AnimatedDivision.js +++ b/Libraries/Animated/nodes/AnimatedDivision.js @@ -10,14 +10,14 @@ 'use strict'; +import type {PlatformConfig} from '../AnimatedPlatformConfig'; +import type {InterpolationConfigType} from './AnimatedInterpolation'; + import AnimatedInterpolation from './AnimatedInterpolation'; import AnimatedNode from './AnimatedNode'; import AnimatedValue from './AnimatedValue'; import AnimatedWithChildren from './AnimatedWithChildren'; -import type {InterpolationConfigType} from './AnimatedInterpolation'; -import type {PlatformConfig} from '../AnimatedPlatformConfig'; - export default class AnimatedDivision extends AnimatedWithChildren { _a: AnimatedNode; _b: AnimatedNode; diff --git a/Libraries/Animated/nodes/AnimatedInterpolation.js b/Libraries/Animated/nodes/AnimatedInterpolation.js index e246cf2742e..be85be6e89d 100644 --- a/Libraries/Animated/nodes/AnimatedInterpolation.js +++ b/Libraries/Animated/nodes/AnimatedInterpolation.js @@ -12,15 +12,13 @@ 'use strict'; +import type {PlatformConfig} from '../AnimatedPlatformConfig'; import type AnimatedNode from './AnimatedNode'; -import AnimatedWithChildren from './AnimatedWithChildren'; -import NativeAnimatedHelper from '../NativeAnimatedHelper'; - -import invariant from 'invariant'; import normalizeColor from '../../StyleSheet/normalizeColor'; - -import type {PlatformConfig} from '../AnimatedPlatformConfig'; +import NativeAnimatedHelper from '../NativeAnimatedHelper'; +import AnimatedWithChildren from './AnimatedWithChildren'; +import invariant from 'invariant'; type ExtrapolateType = 'extend' | 'identity' | 'clamp'; diff --git a/Libraries/Animated/nodes/AnimatedModulo.js b/Libraries/Animated/nodes/AnimatedModulo.js index a465cf075f8..d5334478afd 100644 --- a/Libraries/Animated/nodes/AnimatedModulo.js +++ b/Libraries/Animated/nodes/AnimatedModulo.js @@ -10,14 +10,13 @@ 'use strict'; +import type {PlatformConfig} from '../AnimatedPlatformConfig'; +import type {InterpolationConfigType} from './AnimatedInterpolation'; import type AnimatedNode from './AnimatedNode'; import AnimatedInterpolation from './AnimatedInterpolation'; import AnimatedWithChildren from './AnimatedWithChildren'; -import type {InterpolationConfigType} from './AnimatedInterpolation'; -import type {PlatformConfig} from '../AnimatedPlatformConfig'; - export default class AnimatedModulo extends AnimatedWithChildren { _a: AnimatedNode; _modulus: number; diff --git a/Libraries/Animated/nodes/AnimatedMultiplication.js b/Libraries/Animated/nodes/AnimatedMultiplication.js index d16ddf38fb4..b3cfaf3aed3 100644 --- a/Libraries/Animated/nodes/AnimatedMultiplication.js +++ b/Libraries/Animated/nodes/AnimatedMultiplication.js @@ -10,15 +10,14 @@ 'use strict'; +import type {PlatformConfig} from '../AnimatedPlatformConfig'; +import type {InterpolationConfigType} from './AnimatedInterpolation'; import type AnimatedNode from './AnimatedNode'; import AnimatedInterpolation from './AnimatedInterpolation'; import AnimatedValue from './AnimatedValue'; import AnimatedWithChildren from './AnimatedWithChildren'; -import type {InterpolationConfigType} from './AnimatedInterpolation'; -import type {PlatformConfig} from '../AnimatedPlatformConfig'; - export default class AnimatedMultiplication extends AnimatedWithChildren { _a: AnimatedNode; _b: AnimatedNode; diff --git a/Libraries/Animated/nodes/AnimatedNode.js b/Libraries/Animated/nodes/AnimatedNode.js index d753c2aa172..388052a004c 100644 --- a/Libraries/Animated/nodes/AnimatedNode.js +++ b/Libraries/Animated/nodes/AnimatedNode.js @@ -10,12 +10,11 @@ 'use strict'; -import NativeAnimatedHelper from '../NativeAnimatedHelper'; - -import invariant from 'invariant'; - import type {PlatformConfig} from '../AnimatedPlatformConfig'; +import NativeAnimatedHelper from '../NativeAnimatedHelper'; +import invariant from 'invariant'; + const NativeAnimatedAPI = NativeAnimatedHelper.API; type ValueListenerCallback = (state: {value: number, ...}) => mixed; diff --git a/Libraries/Animated/nodes/AnimatedProps.js b/Libraries/Animated/nodes/AnimatedProps.js index fffa6e496e8..bcaf685e24f 100644 --- a/Libraries/Animated/nodes/AnimatedProps.js +++ b/Libraries/Animated/nodes/AnimatedProps.js @@ -12,13 +12,12 @@ import type {PlatformConfig} from '../AnimatedPlatformConfig'; +import {findNodeHandle} from '../../ReactNative/RendererProxy'; import {AnimatedEvent} from '../AnimatedEvent'; import NativeAnimatedHelper from '../NativeAnimatedHelper'; -import {findNodeHandle} from '../../ReactNative/RendererProxy'; -import invariant from 'invariant'; - import AnimatedNode from './AnimatedNode'; import AnimatedStyle from './AnimatedStyle'; +import invariant from 'invariant'; export default class AnimatedProps extends AnimatedNode { _props: Object; diff --git a/Libraries/Animated/nodes/AnimatedSubtraction.js b/Libraries/Animated/nodes/AnimatedSubtraction.js index 111d720ae92..d9a423b4cbb 100644 --- a/Libraries/Animated/nodes/AnimatedSubtraction.js +++ b/Libraries/Animated/nodes/AnimatedSubtraction.js @@ -10,15 +10,14 @@ 'use strict'; +import type {PlatformConfig} from '../AnimatedPlatformConfig'; +import type {InterpolationConfigType} from './AnimatedInterpolation'; import type AnimatedNode from './AnimatedNode'; import AnimatedInterpolation from './AnimatedInterpolation'; import AnimatedValue from './AnimatedValue'; import AnimatedWithChildren from './AnimatedWithChildren'; -import type {InterpolationConfigType} from './AnimatedInterpolation'; -import type {PlatformConfig} from '../AnimatedPlatformConfig'; - export default class AnimatedSubtraction extends AnimatedWithChildren { _a: AnimatedNode; _b: AnimatedNode; diff --git a/Libraries/Animated/nodes/AnimatedTracking.js b/Libraries/Animated/nodes/AnimatedTracking.js index 6099a23c297..bfaeafed47c 100644 --- a/Libraries/Animated/nodes/AnimatedTracking.js +++ b/Libraries/Animated/nodes/AnimatedTracking.js @@ -10,13 +10,12 @@ 'use strict'; -import type AnimatedValue from './AnimatedValue'; - -import AnimatedNode from './AnimatedNode'; -import NativeAnimatedHelper from '../NativeAnimatedHelper'; - import type {PlatformConfig} from '../AnimatedPlatformConfig'; import type {EndCallback} from '../animations/Animation'; +import type AnimatedValue from './AnimatedValue'; + +import NativeAnimatedHelper from '../NativeAnimatedHelper'; +import AnimatedNode from './AnimatedNode'; export default class AnimatedTracking extends AnimatedNode { _value: AnimatedValue; diff --git a/Libraries/Animated/nodes/AnimatedValue.js b/Libraries/Animated/nodes/AnimatedValue.js index dcb11e36e83..63d91b48e33 100644 --- a/Libraries/Animated/nodes/AnimatedValue.js +++ b/Libraries/Animated/nodes/AnimatedValue.js @@ -10,16 +10,16 @@ 'use strict'; -import AnimatedInterpolation from './AnimatedInterpolation'; -import AnimatedWithChildren from './AnimatedWithChildren'; -import InteractionManager from '../../Interaction/InteractionManager'; -import NativeAnimatedHelper from '../NativeAnimatedHelper'; - -import type AnimatedNode from './AnimatedNode'; import type Animation, {EndCallback} from '../animations/Animation'; import type {InterpolationConfigType} from './AnimatedInterpolation'; +import type AnimatedNode from './AnimatedNode'; import type AnimatedTracking from './AnimatedTracking'; +import InteractionManager from '../../Interaction/InteractionManager'; +import NativeAnimatedHelper from '../NativeAnimatedHelper'; +import AnimatedInterpolation from './AnimatedInterpolation'; +import AnimatedWithChildren from './AnimatedWithChildren'; + export type AnimatedValueConfig = $ReadOnly<{ useNativeDriver: boolean, }>; diff --git a/Libraries/Animated/nodes/AnimatedValueXY.js b/Libraries/Animated/nodes/AnimatedValueXY.js index 4d554f15c04..dc24a674bba 100644 --- a/Libraries/Animated/nodes/AnimatedValueXY.js +++ b/Libraries/Animated/nodes/AnimatedValueXY.js @@ -14,7 +14,6 @@ import type {PlatformConfig} from '../AnimatedPlatformConfig'; import AnimatedValue from './AnimatedValue'; import AnimatedWithChildren from './AnimatedWithChildren'; - import invariant from 'invariant'; export type AnimatedValueXYConfig = $ReadOnly<{ diff --git a/Libraries/Animated/nodes/AnimatedWithChildren.js b/Libraries/Animated/nodes/AnimatedWithChildren.js index d60df641e9c..ac4ade64612 100644 --- a/Libraries/Animated/nodes/AnimatedWithChildren.js +++ b/Libraries/Animated/nodes/AnimatedWithChildren.js @@ -11,8 +11,9 @@ 'use strict'; import type {PlatformConfig} from '../AnimatedPlatformConfig'; -import AnimatedNode from './AnimatedNode'; + import NativeAnimatedHelper from '../NativeAnimatedHelper'; +import AnimatedNode from './AnimatedNode'; export default class AnimatedWithChildren extends AnimatedNode { _children: Array; diff --git a/Libraries/Animated/useAnimatedProps.js b/Libraries/Animated/useAnimatedProps.js index f6d9ae5b8b9..d7329a7e606 100644 --- a/Libraries/Animated/useAnimatedProps.js +++ b/Libraries/Animated/useAnimatedProps.js @@ -10,10 +10,10 @@ 'use strict'; -import AnimatedProps from './nodes/AnimatedProps'; -import {AnimatedEvent} from './AnimatedEvent'; import useRefEffect from '../Utilities/useRefEffect'; +import {AnimatedEvent} from './AnimatedEvent'; import NativeAnimatedHelper from './NativeAnimatedHelper'; +import AnimatedProps from './nodes/AnimatedProps'; import { useCallback, useEffect, diff --git a/Libraries/AppState/AppState.js b/Libraries/AppState/AppState.js index d3cf1c6dacf..f82afa0f614 100644 --- a/Libraries/AppState/AppState.js +++ b/Libraries/AppState/AppState.js @@ -8,11 +8,11 @@ * @format */ -import {type EventSubscription} from '../vendor/emitter/EventEmitter'; import NativeEventEmitter from '../EventEmitter/NativeEventEmitter'; import logError from '../Utilities/logError'; -import NativeAppState from './NativeAppState'; import Platform from '../Utilities/Platform'; +import {type EventSubscription} from '../vendor/emitter/EventEmitter'; +import NativeAppState from './NativeAppState'; export type AppStateValues = 'inactive' | 'background' | 'active'; diff --git a/Libraries/AppState/NativeAppState.js b/Libraries/AppState/NativeAppState.js index d546e70051d..177e167c679 100644 --- a/Libraries/AppState/NativeAppState.js +++ b/Libraries/AppState/NativeAppState.js @@ -9,6 +9,7 @@ */ import type {TurboModule} from '../TurboModule/RCTExport'; + import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry'; export interface Spec extends TurboModule { diff --git a/Libraries/Blob/BlobManager.js b/Libraries/Blob/BlobManager.js index 620e6d90dd8..98e69112957 100644 --- a/Libraries/Blob/BlobManager.js +++ b/Libraries/Blob/BlobManager.js @@ -8,13 +8,14 @@ * @format */ -const Blob = require('./Blob'); -const BlobRegistry = require('./BlobRegistry'); +import type {BlobCollector, BlobData, BlobOptions} from './BlobTypes'; -import type {BlobData, BlobOptions, BlobCollector} from './BlobTypes'; import NativeBlobModule from './NativeBlobModule'; import invariant from 'invariant'; +const Blob = require('./Blob'); +const BlobRegistry = require('./BlobRegistry'); + /*eslint-disable no-bitwise */ /*eslint-disable eqeqeq */ diff --git a/Libraries/Blob/File.js b/Libraries/Blob/File.js index 5aa2dd73c46..6f643307c5d 100644 --- a/Libraries/Blob/File.js +++ b/Libraries/Blob/File.js @@ -10,12 +10,11 @@ 'use strict'; -const Blob = require('./Blob'); - -const invariant = require('invariant'); - import type {BlobOptions} from './BlobTypes'; +const Blob = require('./Blob'); +const invariant = require('invariant'); + /** * The File interface provides information about files. */ diff --git a/Libraries/Blob/FileReader.js b/Libraries/Blob/FileReader.js index ab389c95733..57b3093cf6b 100644 --- a/Libraries/Blob/FileReader.js +++ b/Libraries/Blob/FileReader.js @@ -10,10 +10,10 @@ import type Blob from './Blob'; -const EventTarget = require('event-target-shim'); - import NativeFileReaderModule from './NativeFileReaderModule'; +const EventTarget = require('event-target-shim'); + type ReadyState = | 0 // EMPTY | 1 // LOADING diff --git a/Libraries/Blob/NativeBlobModule.js b/Libraries/Blob/NativeBlobModule.js index 2b474d69352..00a86fae31b 100644 --- a/Libraries/Blob/NativeBlobModule.js +++ b/Libraries/Blob/NativeBlobModule.js @@ -9,6 +9,7 @@ */ import type {TurboModule} from '../TurboModule/RCTExport'; + import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry'; export interface Spec extends TurboModule { diff --git a/Libraries/Blob/NativeFileReaderModule.js b/Libraries/Blob/NativeFileReaderModule.js index ac964b3af42..e581aba74d1 100644 --- a/Libraries/Blob/NativeFileReaderModule.js +++ b/Libraries/Blob/NativeFileReaderModule.js @@ -9,6 +9,7 @@ */ import type {TurboModule} from '../TurboModule/RCTExport'; + import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry'; export interface Spec extends TurboModule { diff --git a/Libraries/BugReporting/NativeBugReporting.js b/Libraries/BugReporting/NativeBugReporting.js index 13a51a585c0..f886208de3d 100644 --- a/Libraries/BugReporting/NativeBugReporting.js +++ b/Libraries/BugReporting/NativeBugReporting.js @@ -9,6 +9,7 @@ */ import type {TurboModule} from '../TurboModule/RCTExport'; + import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry'; export interface Spec extends TurboModule { diff --git a/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js b/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js index be45c92c6f4..195fe747636 100644 --- a/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +++ b/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js @@ -8,16 +8,17 @@ * @format */ +import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; +import type {EventSubscription} from '../../vendor/emitter/EventEmitter'; +import type {AccessibilityInfoType} from './AccessibilityInfo.flow'; +import type {ElementRef} from 'react'; + import RCTDeviceEventEmitter from '../../EventEmitter/RCTDeviceEventEmitter'; import {sendAccessibilityEvent} from '../../ReactNative/RendererProxy'; -import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; import Platform from '../../Utilities/Platform'; -import type {EventSubscription} from '../../vendor/emitter/EventEmitter'; +import legacySendAccessibilityEvent from './legacySendAccessibilityEvent'; import NativeAccessibilityInfoAndroid from './NativeAccessibilityInfo'; import NativeAccessibilityManagerIOS from './NativeAccessibilityManager'; -import legacySendAccessibilityEvent from './legacySendAccessibilityEvent'; -import type {ElementRef} from 'react'; -import type {AccessibilityInfoType} from './AccessibilityInfo.flow'; // Events that are only supported on Android. type AccessibilityEventDefinitionsAndroid = { diff --git a/Libraries/Components/AccessibilityInfo/NativeAccessibilityInfo.js b/Libraries/Components/AccessibilityInfo/NativeAccessibilityInfo.js index beee9e28517..e4661589749 100644 --- a/Libraries/Components/AccessibilityInfo/NativeAccessibilityInfo.js +++ b/Libraries/Components/AccessibilityInfo/NativeAccessibilityInfo.js @@ -9,6 +9,7 @@ */ import type {TurboModule} from '../../TurboModule/RCTExport'; + import * as TurboModuleRegistry from '../../TurboModule/TurboModuleRegistry'; export interface Spec extends TurboModule { diff --git a/Libraries/Components/AccessibilityInfo/NativeAccessibilityManager.js b/Libraries/Components/AccessibilityInfo/NativeAccessibilityManager.js index a8dfc7147e1..f815b18c97b 100644 --- a/Libraries/Components/AccessibilityInfo/NativeAccessibilityManager.js +++ b/Libraries/Components/AccessibilityInfo/NativeAccessibilityManager.js @@ -9,6 +9,7 @@ */ import type {TurboModule} from '../../TurboModule/RCTExport'; + import * as TurboModuleRegistry from '../../TurboModule/TurboModuleRegistry'; export interface Spec extends TurboModule { diff --git a/Libraries/Components/ActivityIndicator/ActivityIndicator.flow.js b/Libraries/Components/ActivityIndicator/ActivityIndicator.flow.js index 712a5b69410..ebfb8272cb2 100644 --- a/Libraries/Components/ActivityIndicator/ActivityIndicator.flow.js +++ b/Libraries/Components/ActivityIndicator/ActivityIndicator.flow.js @@ -9,11 +9,12 @@ */ 'use strict'; -import * as React from 'react'; -import {type ColorValue} from '../../StyleSheet/StyleSheet'; import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; import type {ViewProps} from '../View/ViewPropTypes'; +import {type ColorValue} from '../../StyleSheet/StyleSheet'; +import * as React from 'react'; + type IndicatorSize = number | 'small' | 'large'; type IOSProps = $ReadOnly<{| diff --git a/Libraries/Components/ActivityIndicator/ActivityIndicator.js b/Libraries/Components/ActivityIndicator/ActivityIndicator.js index 1c4fbd67f5d..0b57dc1273b 100644 --- a/Libraries/Components/ActivityIndicator/ActivityIndicator.js +++ b/Libraries/Components/ActivityIndicator/ActivityIndicator.js @@ -10,13 +10,14 @@ */ 'use strict'; -import * as React from 'react'; -import Platform from '../../Utilities/Platform'; -import StyleSheet, {type ColorValue} from '../../StyleSheet/StyleSheet'; -import View from '../View/View'; import type {ViewProps} from '../View/ViewPropTypes'; import type {ActivityIndicator as ActivityIndicatorType} from './ActivityIndicator.flow'; +import StyleSheet, {type ColorValue} from '../../StyleSheet/StyleSheet'; +import Platform from '../../Utilities/Platform'; +import View from '../View/View'; +import * as React from 'react'; + const PlatformActivityIndicator = Platform.OS === 'android' ? require('../ProgressBarAndroid/ProgressBarAndroid') diff --git a/Libraries/Components/ActivityIndicator/ActivityIndicatorViewNativeComponent.js b/Libraries/Components/ActivityIndicator/ActivityIndicatorViewNativeComponent.js index 548069e885d..7394582902d 100644 --- a/Libraries/Components/ActivityIndicator/ActivityIndicatorViewNativeComponent.js +++ b/Libraries/Components/ActivityIndicator/ActivityIndicatorViewNativeComponent.js @@ -8,13 +8,12 @@ * @flow strict-local */ -import type {WithDefault} from '../../Types/CodegenTypes'; - +import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; import type {ColorValue} from '../../StyleSheet/StyleSheet'; +import type {WithDefault} from '../../Types/CodegenTypes'; import type {ViewProps} from '../View/ViewPropTypes'; import codegenNativeComponent from '../../Utilities/codegenNativeComponent'; -import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; type NativeProps = $ReadOnly<{| ...ViewProps, diff --git a/Libraries/Components/ActivityIndicator/__tests__/ActivityIndicator-test.js b/Libraries/Components/ActivityIndicator/__tests__/ActivityIndicator-test.js index a08495457e2..1c133861897 100644 --- a/Libraries/Components/ActivityIndicator/__tests__/ActivityIndicator-test.js +++ b/Libraries/Components/ActivityIndicator/__tests__/ActivityIndicator-test.js @@ -11,10 +11,9 @@ 'use strict'; -const React = require('react'); -const ActivityIndicator = require('../ActivityIndicator'); - const ReactNativeTestTools = require('../../../Utilities/ReactNativeTestTools'); +const ActivityIndicator = require('../ActivityIndicator'); +const React = require('react'); describe('', () => { it('should set displayName to prevent regressions', () => { diff --git a/Libraries/Components/Button.flow.js b/Libraries/Components/Button.flow.js index abf6d00538f..777c546508d 100644 --- a/Libraries/Components/Button.flow.js +++ b/Libraries/Components/Button.flow.js @@ -11,15 +11,15 @@ 'use strict'; -import * as React from 'react'; -import {type ColorValue} from '../StyleSheet/StyleSheet'; - +import type {PressEvent} from '../Types/CoreEventTypes'; import type { - AccessibilityState, AccessibilityActionEvent, AccessibilityActionInfo, + AccessibilityState, } from './View/ViewAccessibility'; -import type {PressEvent} from '../Types/CoreEventTypes'; + +import {type ColorValue} from '../StyleSheet/StyleSheet'; +import * as React from 'react'; type ButtonProps = $ReadOnly<{| /** diff --git a/Libraries/Components/Button.js b/Libraries/Components/Button.js index 08723a7e2f9..f0758e18a2c 100644 --- a/Libraries/Components/Button.js +++ b/Libraries/Components/Button.js @@ -11,22 +11,22 @@ 'use strict'; -import * as React from 'react'; -import Platform from '../Utilities/Platform'; +import type {PressEvent} from '../Types/CoreEventTypes'; +import type {Button as ButtonType} from './Button.flow'; +import type { + AccessibilityActionEvent, + AccessibilityActionInfo, + AccessibilityState, +} from './View/ViewAccessibility'; + import StyleSheet, {type ColorValue} from '../StyleSheet/StyleSheet'; import Text from '../Text/Text'; +import Platform from '../Utilities/Platform'; import TouchableNativeFeedback from './Touchable/TouchableNativeFeedback'; import TouchableOpacity from './Touchable/TouchableOpacity'; import View from './View/View'; import invariant from 'invariant'; -import type {Button as ButtonType} from './Button.flow'; - -import type { - AccessibilityState, - AccessibilityActionEvent, - AccessibilityActionInfo, -} from './View/ViewAccessibility'; -import type {PressEvent} from '../Types/CoreEventTypes'; +import * as React from 'react'; type ButtonProps = $ReadOnly<{| /** diff --git a/Libraries/Components/Clipboard/NativeClipboard.js b/Libraries/Components/Clipboard/NativeClipboard.js index 9e4ee4733f4..d7f26802483 100644 --- a/Libraries/Components/Clipboard/NativeClipboard.js +++ b/Libraries/Components/Clipboard/NativeClipboard.js @@ -9,6 +9,7 @@ */ import type {TurboModule} from '../../TurboModule/RCTExport'; + import * as TurboModuleRegistry from '../../TurboModule/TurboModuleRegistry'; export interface Spec extends TurboModule { diff --git a/Libraries/Components/DatePicker/DatePickerIOS.android.js b/Libraries/Components/DatePicker/DatePickerIOS.android.js index 738d08c51f3..f0b6628733a 100644 --- a/Libraries/Components/DatePicker/DatePickerIOS.android.js +++ b/Libraries/Components/DatePicker/DatePickerIOS.android.js @@ -8,11 +8,12 @@ */ 'use strict'; -import * as React from 'react'; +import type {DatePickerIOSType} from './DatePickerIOS.flow'; + import StyleSheet from '../../StyleSheet/StyleSheet'; import Text from '../../Text/Text'; import View from '../View/View'; -import type {DatePickerIOSType} from './DatePickerIOS.flow'; +import * as React from 'react'; class DummyDatePickerIOS extends React.Component { render() { diff --git a/Libraries/Components/DatePicker/DatePickerIOS.flow.ios.js b/Libraries/Components/DatePicker/DatePickerIOS.flow.ios.js index 85e953a027d..f5671698f68 100644 --- a/Libraries/Components/DatePicker/DatePickerIOS.flow.ios.js +++ b/Libraries/Components/DatePicker/DatePickerIOS.flow.ios.js @@ -10,10 +10,11 @@ // This is a controlled component version of RCTDatePickerIOS. -import * as React from 'react'; import type {SyntheticEvent} from '../../Types/CoreEventTypes'; import type {ViewProps} from '../View/ViewPropTypes'; +import * as React from 'react'; + type Event = SyntheticEvent< $ReadOnly<{| timestamp: number, diff --git a/Libraries/Components/DatePicker/DatePickerIOS.ios.js b/Libraries/Components/DatePicker/DatePickerIOS.ios.js index 566d5756bf6..39e0e660625 100644 --- a/Libraries/Components/DatePicker/DatePickerIOS.ios.js +++ b/Libraries/Components/DatePicker/DatePickerIOS.ios.js @@ -10,18 +10,18 @@ // This is a controlled component version of RCTDatePickerIOS. -import * as React from 'react'; -import RCTDatePickerNativeComponent, { - Commands as DatePickerCommands, -} from './RCTDatePickerNativeComponent'; -import StyleSheet from '../../StyleSheet/StyleSheet'; -import View from '../View/View'; -import invariant from 'invariant'; - import type {SyntheticEvent} from '../../Types/CoreEventTypes'; import type {ViewProps} from '../View/ViewPropTypes'; import type {DatePickerIOSType} from './DatePickerIOS.flow'; +import StyleSheet from '../../StyleSheet/StyleSheet'; +import View from '../View/View'; +import RCTDatePickerNativeComponent, { + Commands as DatePickerCommands, +} from './RCTDatePickerNativeComponent'; +import invariant from 'invariant'; +import * as React from 'react'; + type Event = SyntheticEvent< $ReadOnly<{| timestamp: number, diff --git a/Libraries/Components/DatePicker/RCTDatePickerNativeComponent.js b/Libraries/Components/DatePicker/RCTDatePickerNativeComponent.js index 53216170701..3f43e63f939 100644 --- a/Libraries/Components/DatePicker/RCTDatePickerNativeComponent.js +++ b/Libraries/Components/DatePicker/RCTDatePickerNativeComponent.js @@ -9,15 +9,16 @@ */ import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; +import type { + BubblingEventHandler, + Float, + WithDefault, +} from '../../Types/CodegenTypes'; import type {ViewProps} from '../View/ViewPropTypes'; + import codegenNativeCommands from '../../Utilities/codegenNativeCommands'; import codegenNativeComponent from '../../Utilities/codegenNativeComponent'; import * as React from 'react'; -import type { - Float, - WithDefault, - BubblingEventHandler, -} from '../../Types/CodegenTypes'; type Event = $ReadOnly<{| timestamp: Float, diff --git a/Libraries/Components/DatePicker/__tests__/DatePickerIOS-test.js b/Libraries/Components/DatePicker/__tests__/DatePickerIOS-test.js index d6c34e12fa9..73ecf39e288 100644 --- a/Libraries/Components/DatePicker/__tests__/DatePickerIOS-test.js +++ b/Libraries/Components/DatePicker/__tests__/DatePickerIOS-test.js @@ -11,10 +11,9 @@ 'use strict'; -const React = require('react'); -const DatePickerIOS = require('../DatePickerIOS'); - const ReactNativeTestTools = require('../../../Utilities/ReactNativeTestTools'); +const DatePickerIOS = require('../DatePickerIOS'); +const React = require('react'); describe('DatePickerIOS', () => { it('should render as expected', () => { diff --git a/Libraries/Components/DatePickerAndroid/NativeDatePickerAndroid.js b/Libraries/Components/DatePickerAndroid/NativeDatePickerAndroid.js index 91241706eb3..972e3e0aed8 100644 --- a/Libraries/Components/DatePickerAndroid/NativeDatePickerAndroid.js +++ b/Libraries/Components/DatePickerAndroid/NativeDatePickerAndroid.js @@ -9,6 +9,7 @@ */ import type {TurboModule} from '../../TurboModule/RCTExport'; + import * as TurboModuleRegistry from '../../TurboModule/TurboModuleRegistry'; /** diff --git a/Libraries/Components/DrawerAndroid/AndroidDrawerLayoutNativeComponent.js b/Libraries/Components/DrawerAndroid/AndroidDrawerLayoutNativeComponent.js index f08ec3a0c16..ced6d34a9ab 100644 --- a/Libraries/Components/DrawerAndroid/AndroidDrawerLayoutNativeComponent.js +++ b/Libraries/Components/DrawerAndroid/AndroidDrawerLayoutNativeComponent.js @@ -8,17 +8,18 @@ * @flow strict-local */ -import type {ViewProps} from '../View/ViewPropTypes'; +import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; import type {ColorValue} from '../../StyleSheet/StyleSheet'; import type { - WithDefault, DirectEventHandler, - Int32, Float, + Int32, + WithDefault, } from '../../Types/CodegenTypes'; +import type {ViewProps} from '../View/ViewPropTypes'; + import codegenNativeCommands from '../../Utilities/codegenNativeCommands'; import codegenNativeComponent from '../../Utilities/codegenNativeComponent'; -import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; import * as React from 'react'; type DrawerStateEvent = $ReadOnly<{| diff --git a/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js b/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js index 78fc70dc0bf..10e265c553c 100644 --- a/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +++ b/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js @@ -8,29 +8,27 @@ * @format */ -import Platform from '../../Utilities/Platform'; -import * as React from 'react'; -import StatusBar from '../StatusBar/StatusBar'; +import type { + MeasureInWindowOnSuccessCallback, + MeasureLayoutOnSuccessCallback, + MeasureOnSuccessCallback, +} from '../../Renderer/shims/ReactNativeTypes'; +import type {ColorValue, ViewStyleProp} from '../../StyleSheet/StyleSheet'; +import type {DirectEventHandler} from '../../Types/CodegenTypes'; + import StyleSheet from '../../StyleSheet/StyleSheet'; -import View from '../View/View'; - import dismissKeyboard from '../../Utilities/dismissKeyboard'; -import nullthrows from 'nullthrows'; - +import Platform from '../../Utilities/Platform'; +import StatusBar from '../StatusBar/StatusBar'; +import View from '../View/View'; import AndroidDrawerLayoutNativeComponent, { Commands, } from './AndroidDrawerLayoutNativeComponent'; +import nullthrows from 'nullthrows'; +import * as React from 'react'; const DRAWER_STATES = ['Idle', 'Dragging', 'Settling']; -import type {ColorValue, ViewStyleProp} from '../../StyleSheet/StyleSheet'; -import type {DirectEventHandler} from '../../Types/CodegenTypes'; -import type { - MeasureOnSuccessCallback, - MeasureInWindowOnSuccessCallback, - MeasureLayoutOnSuccessCallback, -} from '../../Renderer/shims/ReactNativeTypes'; - type DrawerStates = 'Idle' | 'Dragging' | 'Settling'; type DrawerSlideEvent = $ReadOnly<{| diff --git a/Libraries/Components/DrawerAndroid/__tests__/DrawerAndroid-test.js b/Libraries/Components/DrawerAndroid/__tests__/DrawerAndroid-test.js index db9c10fe875..5a9896c1e05 100644 --- a/Libraries/Components/DrawerAndroid/__tests__/DrawerAndroid-test.js +++ b/Libraries/Components/DrawerAndroid/__tests__/DrawerAndroid-test.js @@ -11,14 +11,13 @@ 'use strict'; -const React = require('react'); +const ReactNativeTestTools = require('../../../Utilities/ReactNativeTestTools'); +const View = require('../../View/View'); /* $FlowFixMe[cannot-resolve-module] (>=0.99.0 site=react_native_ios_fb) This * comment suppresses an error found when Flow v0.99 was deployed. To see the * error, delete this comment and run Flow. */ const DrawerLayoutAndroid = require('../DrawerLayoutAndroid.android'); -const View = require('../../View/View'); - -const ReactNativeTestTools = require('../../../Utilities/ReactNativeTestTools'); +const React = require('react'); describe('', () => { it('should render as expected', () => { diff --git a/Libraries/Components/Keyboard/Keyboard.js b/Libraries/Components/Keyboard/Keyboard.js index 8557028b3f4..8aae204e97f 100644 --- a/Libraries/Components/Keyboard/Keyboard.js +++ b/Libraries/Components/Keyboard/Keyboard.js @@ -8,12 +8,13 @@ * @flow strict-local */ +import type {EventSubscription} from '../../vendor/emitter/EventEmitter'; + import NativeEventEmitter from '../../EventEmitter/NativeEventEmitter'; import LayoutAnimation from '../../LayoutAnimation/LayoutAnimation'; import dismissKeyboard from '../../Utilities/dismissKeyboard'; import Platform from '../../Utilities/Platform'; import NativeKeyboardObserver from './NativeKeyboardObserver'; -import type {EventSubscription} from '../../vendor/emitter/EventEmitter'; export type KeyboardEventName = $Keys; diff --git a/Libraries/Components/Keyboard/KeyboardAvoidingView.js b/Libraries/Components/Keyboard/KeyboardAvoidingView.js index da9e6a2c700..2f48f9e677a 100644 --- a/Libraries/Components/Keyboard/KeyboardAvoidingView.js +++ b/Libraries/Components/Keyboard/KeyboardAvoidingView.js @@ -8,22 +8,22 @@ * @flow strict-local */ -import Keyboard from './Keyboard'; -import LayoutAnimation from '../../LayoutAnimation/LayoutAnimation'; -import Platform from '../../Utilities/Platform'; -import * as React from 'react'; -import StyleSheet from '../../StyleSheet/StyleSheet'; -import View from '../View/View'; - import type {ViewStyleProp} from '../../StyleSheet/StyleSheet'; -import {type EventSubscription} from '../../vendor/emitter/EventEmitter'; import type { - ViewProps, ViewLayout, ViewLayoutEvent, + ViewProps, } from '../View/ViewPropTypes'; import type {KeyboardEvent, KeyboardMetrics} from './Keyboard'; + +import LayoutAnimation from '../../LayoutAnimation/LayoutAnimation'; +import StyleSheet from '../../StyleSheet/StyleSheet'; +import Platform from '../../Utilities/Platform'; +import {type EventSubscription} from '../../vendor/emitter/EventEmitter'; import AccessibilityInfo from '../AccessibilityInfo/AccessibilityInfo'; +import View from '../View/View'; +import Keyboard from './Keyboard'; +import * as React from 'react'; type Props = $ReadOnly<{| ...ViewProps, diff --git a/Libraries/Components/Keyboard/NativeKeyboardObserver.js b/Libraries/Components/Keyboard/NativeKeyboardObserver.js index 2dfa7500e27..2dff4a1d1d5 100644 --- a/Libraries/Components/Keyboard/NativeKeyboardObserver.js +++ b/Libraries/Components/Keyboard/NativeKeyboardObserver.js @@ -9,6 +9,7 @@ */ import type {TurboModule} from '../../TurboModule/RCTExport'; + import * as TurboModuleRegistry from '../../TurboModule/TurboModuleRegistry'; export interface Spec extends TurboModule { diff --git a/Libraries/Components/Pressable/Pressable.js b/Libraries/Components/Pressable/Pressable.js index 47498ac37f1..976509109f2 100644 --- a/Libraries/Components/Pressable/Pressable.js +++ b/Libraries/Components/Pressable/Pressable.js @@ -8,11 +8,11 @@ * @format */ -import * as React from 'react'; -import {useMemo, useState, useRef, useImperativeHandle} from 'react'; -import useAndroidRippleForView, { - type RippleConfig, -} from './useAndroidRippleForView'; +import type { + LayoutEvent, + MouseEvent, + PressEvent, +} from '../../Types/CoreEventTypes'; import type { AccessibilityActionEvent, AccessibilityActionInfo, @@ -20,15 +20,16 @@ import type { AccessibilityState, AccessibilityValue, } from '../View/ViewAccessibility'; + import {PressabilityDebugView} from '../../Pressability/PressabilityDebug'; import usePressability from '../../Pressability/usePressability'; import {type RectOrSize} from '../../StyleSheet/Rect'; -import type { - LayoutEvent, - MouseEvent, - PressEvent, -} from '../../Types/CoreEventTypes'; import View from '../View/View'; +import useAndroidRippleForView, { + type RippleConfig, +} from './useAndroidRippleForView'; +import * as React from 'react'; +import {useImperativeHandle, useMemo, useRef, useState} from 'react'; type ViewStyleProp = $ElementType, 'style'>; diff --git a/Libraries/Components/Pressable/__tests__/Pressable-test.js b/Libraries/Components/Pressable/__tests__/Pressable-test.js index 29a3071d8bc..4aba2feefcc 100644 --- a/Libraries/Components/Pressable/__tests__/Pressable-test.js +++ b/Libraries/Components/Pressable/__tests__/Pressable-test.js @@ -9,11 +9,10 @@ * @oncall react_native */ -import * as React from 'react'; - -import Pressable from '../Pressable'; -import View from '../../View/View'; import {expectRendersMatchingSnapshot} from '../../../Utilities/ReactNativeTestTools'; +import View from '../../View/View'; +import Pressable from '../Pressable'; +import * as React from 'react'; describe('', () => { it('should render as expected', () => { diff --git a/Libraries/Components/Pressable/useAndroidRippleForView.js b/Libraries/Components/Pressable/useAndroidRippleForView.js index 459c2628b36..6c4cb1e2baa 100644 --- a/Libraries/Components/Pressable/useAndroidRippleForView.js +++ b/Libraries/Components/Pressable/useAndroidRippleForView.js @@ -8,13 +8,14 @@ * @format */ -import invariant from 'invariant'; -import {Commands} from '../View/ViewNativeComponent'; import type {ColorValue} from '../../StyleSheet/StyleSheet'; import type {PressEvent} from '../../Types/CoreEventTypes'; + +import processColor from '../../StyleSheet/processColor'; import Platform from '../../Utilities/Platform'; import View from '../View/View'; -import processColor from '../../StyleSheet/processColor'; +import {Commands} from '../View/ViewNativeComponent'; +import invariant from 'invariant'; import * as React from 'react'; import {useMemo} from 'react'; diff --git a/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js b/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js index cae4e4dc7df..a34a432a55f 100644 --- a/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js +++ b/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js @@ -8,12 +8,12 @@ * @format */ -const React = require('react'); +import type {ColorValue} from '../../StyleSheet/StyleSheet'; +import type {ViewProps} from '../View/ViewPropTypes'; import ProgressBarAndroidNativeComponent from './ProgressBarAndroidNativeComponent'; -import type {ViewProps} from '../View/ViewPropTypes'; -import type {ColorValue} from '../../StyleSheet/StyleSheet'; +const React = require('react'); export type ProgressBarAndroidProps = $ReadOnly<{| ...ViewProps, diff --git a/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidNativeComponent.js b/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidNativeComponent.js index 625542b05ba..2dc49e65a37 100644 --- a/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidNativeComponent.js +++ b/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidNativeComponent.js @@ -8,12 +8,12 @@ * @format */ +import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; import type {ColorValue} from '../../StyleSheet/StyleSheet'; -import type {ViewProps} from '../View/ViewPropTypes'; import type {Double, WithDefault} from '../../Types/CodegenTypes'; +import type {ViewProps} from '../View/ViewPropTypes'; import codegenNativeComponent from '../../Utilities/codegenNativeComponent'; -import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; type NativeProps = $ReadOnly<{| ...ViewProps, diff --git a/Libraries/Components/ProgressBarAndroid/__tests__/ProgressBarAndroid-test.js b/Libraries/Components/ProgressBarAndroid/__tests__/ProgressBarAndroid-test.js index c616e24f852..e293e129314 100644 --- a/Libraries/Components/ProgressBarAndroid/__tests__/ProgressBarAndroid-test.js +++ b/Libraries/Components/ProgressBarAndroid/__tests__/ProgressBarAndroid-test.js @@ -11,13 +11,12 @@ 'use strict'; -const React = require('react'); +const ReactNativeTestTools = require('../../../Utilities/ReactNativeTestTools'); /* $FlowFixMe[cannot-resolve-module] (>=0.99.0 site=react_native_ios_fb) This * comment suppresses an error found when Flow v0.99 was deployed. To see the * error, delete this comment and run Flow. */ const ProgressBarAndroid = require('../ProgressBarAndroid.android'); - -const ReactNativeTestTools = require('../../../Utilities/ReactNativeTestTools'); +const React = require('react'); describe('', () => { it('should render as expected', () => { diff --git a/Libraries/Components/ProgressViewIOS/ProgressViewIOS.android.js b/Libraries/Components/ProgressViewIOS/ProgressViewIOS.android.js index 4150bbf2008..0dffafceeb8 100644 --- a/Libraries/Components/ProgressViewIOS/ProgressViewIOS.android.js +++ b/Libraries/Components/ProgressViewIOS/ProgressViewIOS.android.js @@ -8,10 +8,10 @@ */ 'use strict'; -import * as React from 'react'; import StyleSheet from '../../StyleSheet/StyleSheet'; import Text from '../../Text/Text'; import View from '../View/View'; +import * as React from 'react'; class DummyProgressViewIOS extends React.Component { render() { diff --git a/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js b/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js index 2712055e649..65750946ab0 100644 --- a/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js +++ b/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js @@ -8,13 +8,13 @@ * @flow strict-local */ -import * as React from 'react'; -import StyleSheet, {type ColorValue} from '../../StyleSheet/StyleSheet'; - -import RCTProgressViewNativeComponent from './RCTProgressViewNativeComponent'; import type {ImageSource} from '../../Image/ImageSource'; import type {ViewProps} from '../View/ViewPropTypes'; +import StyleSheet, {type ColorValue} from '../../StyleSheet/StyleSheet'; +import RCTProgressViewNativeComponent from './RCTProgressViewNativeComponent'; +import * as React from 'react'; + type Props = $ReadOnly<{| ...ViewProps, diff --git a/Libraries/Components/ProgressViewIOS/RCTProgressViewNativeComponent.js b/Libraries/Components/ProgressViewIOS/RCTProgressViewNativeComponent.js index cd833d0cf38..be2f70af5d4 100644 --- a/Libraries/Components/ProgressViewIOS/RCTProgressViewNativeComponent.js +++ b/Libraries/Components/ProgressViewIOS/RCTProgressViewNativeComponent.js @@ -8,13 +8,13 @@ * @format */ -import type {Float, WithDefault} from '../../Types/CodegenTypes'; import type {ImageSource} from '../../Image/ImageSource'; +import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; import type {ColorValue} from '../../StyleSheet/StyleSheet'; +import type {Float, WithDefault} from '../../Types/CodegenTypes'; import type {ViewProps} from '../View/ViewPropTypes'; import codegenNativeComponent from '../../Utilities/codegenNativeComponent'; -import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; type NativeProps = $ReadOnly<{| ...ViewProps, diff --git a/Libraries/Components/ProgressViewIOS/__tests__/ProgressViewIOS-test.js b/Libraries/Components/ProgressViewIOS/__tests__/ProgressViewIOS-test.js index a636eef0a99..0c59a614f8f 100644 --- a/Libraries/Components/ProgressViewIOS/__tests__/ProgressViewIOS-test.js +++ b/Libraries/Components/ProgressViewIOS/__tests__/ProgressViewIOS-test.js @@ -11,10 +11,9 @@ 'use strict'; -const React = require('react'); -const ProgressViewIOS = require('../ProgressViewIOS'); - const ReactNativeTestTools = require('../../../Utilities/ReactNativeTestTools'); +const ProgressViewIOS = require('../ProgressViewIOS'); +const React = require('react'); describe('', () => { it('should render as expected', () => { diff --git a/Libraries/Components/RefreshControl/AndroidSwipeRefreshLayoutNativeComponent.js b/Libraries/Components/RefreshControl/AndroidSwipeRefreshLayoutNativeComponent.js index 34ff49636f4..dd76d15d61d 100644 --- a/Libraries/Components/RefreshControl/AndroidSwipeRefreshLayoutNativeComponent.js +++ b/Libraries/Components/RefreshControl/AndroidSwipeRefreshLayoutNativeComponent.js @@ -8,20 +8,19 @@ * @flow strict-local */ -import * as React from 'react'; - -import codegenNativeCommands from '../../Utilities/codegenNativeCommands'; -import codegenNativeComponent from '../../Utilities/codegenNativeComponent'; import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; - +import type {ColorValue} from '../../StyleSheet/StyleSheet'; import type { DirectEventHandler, Float, WithDefault, } from '../../Types/CodegenTypes'; -import type {ColorValue} from '../../StyleSheet/StyleSheet'; import type {ViewProps} from '../View/ViewPropTypes'; +import codegenNativeCommands from '../../Utilities/codegenNativeCommands'; +import codegenNativeComponent from '../../Utilities/codegenNativeComponent'; +import * as React from 'react'; + type NativeProps = $ReadOnly<{| ...ViewProps, diff --git a/Libraries/Components/RefreshControl/PullToRefreshViewNativeComponent.js b/Libraries/Components/RefreshControl/PullToRefreshViewNativeComponent.js index 50c7edbbc5d..f47880e111d 100644 --- a/Libraries/Components/RefreshControl/PullToRefreshViewNativeComponent.js +++ b/Libraries/Components/RefreshControl/PullToRefreshViewNativeComponent.js @@ -8,18 +8,18 @@ * @flow strict-local */ +import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; +import type {ColorValue} from '../../StyleSheet/StyleSheet'; import type { DirectEventHandler, Float, WithDefault, } from '../../Types/CodegenTypes'; -import type {ColorValue} from '../../StyleSheet/StyleSheet'; import type {ViewProps} from '../View/ViewPropTypes'; -import * as React from 'react'; -import codegenNativeComponent from '../../Utilities/codegenNativeComponent'; -import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; import codegenNativeCommands from '../../Utilities/codegenNativeCommands'; +import codegenNativeComponent from '../../Utilities/codegenNativeComponent'; +import * as React from 'react'; type NativeProps = $ReadOnly<{| ...ViewProps, diff --git a/Libraries/Components/RefreshControl/RefreshControl.js b/Libraries/Components/RefreshControl/RefreshControl.js index f62a893b489..e40344ec969 100644 --- a/Libraries/Components/RefreshControl/RefreshControl.js +++ b/Libraries/Components/RefreshControl/RefreshControl.js @@ -8,11 +8,9 @@ * @flow */ -const Platform = require('../../Utilities/Platform'); -const React = require('react'); - import type {ColorValue} from '../../StyleSheet/StyleSheet'; import type {ViewProps} from '../View/ViewPropTypes'; + import AndroidSwipeRefreshLayoutNativeComponent, { Commands as AndroidSwipeRefreshLayoutCommands, } from './AndroidSwipeRefreshLayoutNativeComponent'; @@ -20,6 +18,9 @@ import PullToRefreshViewNativeComponent, { Commands as PullToRefreshCommands, } from './PullToRefreshViewNativeComponent'; +const Platform = require('../../Utilities/Platform'); +const React = require('react'); + type IOSProps = $ReadOnly<{| /** * The color of the refresh indicator. diff --git a/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js b/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js index 80c6126641d..005c7e42db2 100644 --- a/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +++ b/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js @@ -9,11 +9,10 @@ */ 'use strict'; -import * as React from 'react'; +import type {HostComponent} from '../../../Renderer/shims/ReactNativeTypes'; import requireNativeComponent from '../../../ReactNative/requireNativeComponent'; - -import type {HostComponent} from '../../../Renderer/shims/ReactNativeTypes'; +import * as React from 'react'; const RCTRefreshControl: HostComponent = requireNativeComponent('RCTRefreshControl'); diff --git a/Libraries/Components/SafeAreaView/RCTSafeAreaViewNativeComponent.js b/Libraries/Components/SafeAreaView/RCTSafeAreaViewNativeComponent.js index 8cf1333d136..ff0d08ae5ce 100644 --- a/Libraries/Components/SafeAreaView/RCTSafeAreaViewNativeComponent.js +++ b/Libraries/Components/SafeAreaView/RCTSafeAreaViewNativeComponent.js @@ -8,10 +8,10 @@ * @flow strict-local */ +import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; import type {ViewProps} from '../View/ViewPropTypes'; import codegenNativeComponent from '../../Utilities/codegenNativeComponent'; -import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; type NativeProps = $ReadOnly<{| ...ViewProps, diff --git a/Libraries/Components/SafeAreaView/SafeAreaView.flow.js b/Libraries/Components/SafeAreaView/SafeAreaView.flow.js index 3ec7c9efedb..77d04f50ec9 100644 --- a/Libraries/Components/SafeAreaView/SafeAreaView.flow.js +++ b/Libraries/Components/SafeAreaView/SafeAreaView.flow.js @@ -8,11 +8,11 @@ * @format */ -import * as React from 'react'; -import View from '../View/View'; - import type {ViewProps} from '../View/ViewPropTypes'; +import View from '../View/View'; +import * as React from 'react'; + export type SafeAreaViewType = React.AbstractComponent< ViewProps, React.ElementRef, diff --git a/Libraries/Components/SafeAreaView/SafeAreaView.js b/Libraries/Components/SafeAreaView/SafeAreaView.js index 2c9c3887f0c..43f1689266a 100644 --- a/Libraries/Components/SafeAreaView/SafeAreaView.js +++ b/Libraries/Components/SafeAreaView/SafeAreaView.js @@ -8,13 +8,13 @@ * @format */ -import Platform from '../../Utilities/Platform'; -import * as React from 'react'; -import View from '../View/View'; - import type {ViewProps} from '../View/ViewPropTypes'; import type {SafeAreaViewType} from './SafeAreaView.flow'; +import Platform from '../../Utilities/Platform'; +import View from '../View/View'; +import * as React from 'react'; + let exported: React.AbstractComponent>; /** diff --git a/Libraries/Components/SafeAreaView/__tests__/SafeAreaView-test.js b/Libraries/Components/SafeAreaView/__tests__/SafeAreaView-test.js index 7003b0e6700..c3dcd55e41c 100644 --- a/Libraries/Components/SafeAreaView/__tests__/SafeAreaView-test.js +++ b/Libraries/Components/SafeAreaView/__tests__/SafeAreaView-test.js @@ -11,11 +11,12 @@ 'use strict'; -const React = require('react'); import SafeAreaView from '../SafeAreaView'; + +const Text = require('../../../Text/Text'); const ReactNativeTestTools = require('../../../Utilities/ReactNativeTestTools'); const View = require('../../View/View'); -const Text = require('../../../Text/Text'); +const React = require('react'); describe('', () => { it('should render as expected', () => { diff --git a/Libraries/Components/ScrollView/AndroidHorizontalScrollContentViewNativeComponent.js b/Libraries/Components/ScrollView/AndroidHorizontalScrollContentViewNativeComponent.js index 63f6e660d53..50b814a93b9 100644 --- a/Libraries/Components/ScrollView/AndroidHorizontalScrollContentViewNativeComponent.js +++ b/Libraries/Components/ScrollView/AndroidHorizontalScrollContentViewNativeComponent.js @@ -8,10 +8,11 @@ * @flow strict-local */ -import codegenNativeComponent from '../../Utilities/codegenNativeComponent'; import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; import type {ViewProps} from '../View/ViewPropTypes'; +import codegenNativeComponent from '../../Utilities/codegenNativeComponent'; + type NativeProps = $ReadOnly<{| ...ViewProps, diff --git a/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js b/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js index 7b2ce2060d2..e0414b9b232 100644 --- a/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +++ b/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js @@ -8,11 +8,12 @@ * @format */ -import type {ScrollViewNativeProps as Props} from './ScrollViewNativeComponentType'; import type { HostComponent, PartialViewConfig, } from '../../Renderer/shims/ReactNativeTypes'; +import type {ScrollViewNativeProps as Props} from './ScrollViewNativeComponentType'; + import * as NativeComponentRegistry from '../../NativeComponent/NativeComponentRegistry'; export const __INTERNAL_VIEW_CONFIG: PartialViewConfig = { diff --git a/Libraries/Components/ScrollView/ScrollContentViewNativeComponent.js b/Libraries/Components/ScrollView/ScrollContentViewNativeComponent.js index 09038e84ff0..bd7278c93d0 100644 --- a/Libraries/Components/ScrollView/ScrollContentViewNativeComponent.js +++ b/Libraries/Components/ScrollView/ScrollContentViewNativeComponent.js @@ -12,9 +12,10 @@ import type { HostComponent, PartialViewConfig, } from '../../Renderer/shims/ReactNativeTypes'; -import * as NativeComponentRegistry from '../../NativeComponent/NativeComponentRegistry'; import type {ViewProps as Props} from '../View/ViewPropTypes'; +import * as NativeComponentRegistry from '../../NativeComponent/NativeComponentRegistry'; + export const __INTERNAL_VIEW_CONFIG: PartialViewConfig = { uiViewClassName: 'RCTScrollContentView', bubblingEventTypes: {}, diff --git a/Libraries/Components/ScrollView/ScrollView.js b/Libraries/Components/ScrollView/ScrollView.js index f4dff151bd3..134f74a526d 100644 --- a/Libraries/Components/ScrollView/ScrollView.js +++ b/Libraries/Components/ScrollView/ScrollView.js @@ -8,47 +8,45 @@ * @flow strict-local */ -import AnimatedImplementation from '../../Animated/AnimatedImplementation'; -import Dimensions from '../../Utilities/Dimensions'; -import Platform from '../../Utilities/Platform'; -import * as React from 'react'; -import {findNodeHandle} from '../../ReactNative/RendererProxy'; -import ScrollViewStickyHeader from './ScrollViewStickyHeader'; -import StyleSheet from '../../StyleSheet/StyleSheet'; -import View from '../View/View'; -import UIManager from '../../ReactNative/UIManager'; -import Keyboard from '../Keyboard/Keyboard'; -import FrameRateLogger from '../../Interaction/FrameRateLogger'; -import TextInputState from '../TextInput/TextInputState'; - -import dismissKeyboard from '../../Utilities/dismissKeyboard'; -import flattenStyle from '../../StyleSheet/flattenStyle'; -import invariant from 'invariant'; -import processDecelerationRate from './processDecelerationRate'; -import splitLayoutProps from '../../StyleSheet/splitLayoutProps'; -import setAndForwardRef from '../../Utilities/setAndForwardRef'; - +import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; import type {EdgeInsetsProp} from '../../StyleSheet/EdgeInsetsPropType'; import type {PointProp} from '../../StyleSheet/PointPropType'; import type {ViewStyleProp} from '../../StyleSheet/StyleSheet'; import type {ColorValue} from '../../StyleSheet/StyleSheet'; import type { + LayoutEvent, PressEvent, ScrollEvent, - LayoutEvent, } from '../../Types/CoreEventTypes'; -import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; -import type {ViewProps} from '../View/ViewPropTypes'; -import ScrollViewContext, {HORIZONTAL, VERTICAL} from './ScrollViewContext'; -import type {Props as ScrollViewStickyHeaderProps} from './ScrollViewStickyHeader'; -import type {KeyboardEvent, KeyboardMetrics} from '../Keyboard/Keyboard'; import type {EventSubscription} from '../../vendor/emitter/EventEmitter'; +import type {KeyboardEvent, KeyboardMetrics} from '../Keyboard/Keyboard'; +import type {ViewProps} from '../View/ViewPropTypes'; +import type {Props as ScrollViewStickyHeaderProps} from './ScrollViewStickyHeader'; -import Commands from './ScrollViewCommands'; +import AnimatedImplementation from '../../Animated/AnimatedImplementation'; +import FrameRateLogger from '../../Interaction/FrameRateLogger'; +import {findNodeHandle} from '../../ReactNative/RendererProxy'; +import UIManager from '../../ReactNative/UIManager'; +import flattenStyle from '../../StyleSheet/flattenStyle'; +import splitLayoutProps from '../../StyleSheet/splitLayoutProps'; +import StyleSheet from '../../StyleSheet/StyleSheet'; +import Dimensions from '../../Utilities/Dimensions'; +import dismissKeyboard from '../../Utilities/dismissKeyboard'; +import Platform from '../../Utilities/Platform'; +import setAndForwardRef from '../../Utilities/setAndForwardRef'; +import Keyboard from '../Keyboard/Keyboard'; +import TextInputState from '../TextInput/TextInputState'; +import View from '../View/View'; import AndroidHorizontalScrollContentViewNativeComponent from './AndroidHorizontalScrollContentViewNativeComponent'; import AndroidHorizontalScrollViewNativeComponent from './AndroidHorizontalScrollViewNativeComponent'; +import processDecelerationRate from './processDecelerationRate'; import ScrollContentViewNativeComponent from './ScrollContentViewNativeComponent'; +import Commands from './ScrollViewCommands'; +import ScrollViewContext, {HORIZONTAL, VERTICAL} from './ScrollViewContext'; import ScrollViewNativeComponent from './ScrollViewNativeComponent'; +import ScrollViewStickyHeader from './ScrollViewStickyHeader'; +import invariant from 'invariant'; +import * as React from 'react'; if (Platform.OS === 'ios') { require('../../Renderer/shims/ReactNative'); // Force side effects to prevent T55744311 diff --git a/Libraries/Components/ScrollView/ScrollViewCommands.js b/Libraries/Components/ScrollView/ScrollViewCommands.js index c506cdf3435..6ff89b42017 100644 --- a/Libraries/Components/ScrollView/ScrollViewCommands.js +++ b/Libraries/Components/ScrollView/ScrollViewCommands.js @@ -8,11 +8,11 @@ * @flow strict-local */ -import codegenNativeCommands from '../../Utilities/codegenNativeCommands'; -import * as React from 'react'; +import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; import type {Double} from '../../Types/CodegenTypes'; -import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; +import codegenNativeCommands from '../../Utilities/codegenNativeCommands'; +import * as React from 'react'; type ScrollViewNativeComponentType = HostComponent; interface NativeCommands { diff --git a/Libraries/Components/ScrollView/ScrollViewNativeComponent.js b/Libraries/Components/ScrollView/ScrollViewNativeComponent.js index 675ee113fd7..efe08ab4ce0 100644 --- a/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +++ b/Libraries/Components/ScrollView/ScrollViewNativeComponent.js @@ -8,11 +8,12 @@ * @format */ -import type {ScrollViewNativeProps as Props} from './ScrollViewNativeComponentType'; import type { HostComponent, PartialViewConfig, } from '../../Renderer/shims/ReactNativeTypes'; +import type {ScrollViewNativeProps as Props} from './ScrollViewNativeComponentType'; + import * as NativeComponentRegistry from '../../NativeComponent/NativeComponentRegistry'; import {ConditionallyIgnoredEventHandlers} from '../../NativeComponent/ViewConfigIgnore'; import Platform from '../../Utilities/Platform'; diff --git a/Libraries/Components/ScrollView/ScrollViewNativeComponentType.js b/Libraries/Components/ScrollView/ScrollViewNativeComponentType.js index 95661494722..b1b2df5d84e 100644 --- a/Libraries/Components/ScrollView/ScrollViewNativeComponentType.js +++ b/Libraries/Components/ScrollView/ScrollViewNativeComponentType.js @@ -10,11 +10,11 @@ 'use strict'; -import type {ViewProps} from '../View/ViewPropTypes'; -import type {ColorValue} from '../../StyleSheet/StyleSheet'; import type {EdgeInsetsProp} from '../../StyleSheet/EdgeInsetsPropType'; -import type {ScrollEvent} from '../../Types/CoreEventTypes'; import type {PointProp} from '../../StyleSheet/PointPropType'; +import type {ColorValue} from '../../StyleSheet/StyleSheet'; +import type {ScrollEvent} from '../../Types/CoreEventTypes'; +import type {ViewProps} from '../View/ViewPropTypes'; export type ScrollViewNativeProps = $ReadOnly<{ ...ViewProps, diff --git a/Libraries/Components/ScrollView/ScrollViewStickyHeader.js b/Libraries/Components/ScrollView/ScrollViewStickyHeader.js index f6ca3ac8e1e..4a445dc53d5 100644 --- a/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +++ b/Libraries/Components/ScrollView/ScrollViewStickyHeader.js @@ -8,17 +8,16 @@ * @format */ +import type {LayoutEvent} from '../../Types/CoreEventTypes'; + import AnimatedImplementation from '../../Animated/AnimatedImplementation'; import AnimatedAddition from '../../Animated/nodes/AnimatedAddition'; import AnimatedDiffClamp from '../../Animated/nodes/AnimatedDiffClamp'; import AnimatedNode from '../../Animated/nodes/AnimatedNode'; - -import * as React from 'react'; import StyleSheet from '../../StyleSheet/StyleSheet'; -import View from '../View/View'; import Platform from '../../Utilities/Platform'; - -import type {LayoutEvent} from '../../Types/CoreEventTypes'; +import View from '../View/View'; +import * as React from 'react'; const AnimatedView = AnimatedImplementation.createAnimatedComponent(View); diff --git a/Libraries/Components/ScrollView/__tests__/ScrollView-test.js b/Libraries/Components/ScrollView/__tests__/ScrollView-test.js index 7711562fff2..6081d8db9c1 100644 --- a/Libraries/Components/ScrollView/__tests__/ScrollView-test.js +++ b/Libraries/Components/ScrollView/__tests__/ScrollView-test.js @@ -11,12 +11,12 @@ 'use strict'; -const React = require('react'); -const ScrollView = require('../ScrollView'); -const ReactNativeTestTools = require('../../../Utilities/ReactNativeTestTools'); -const ReactTestRenderer = require('react-test-renderer'); -const View = require('../../View/View'); const Text = require('../../../Text/Text'); +const ReactNativeTestTools = require('../../../Utilities/ReactNativeTestTools'); +const View = require('../../View/View'); +const ScrollView = require('../ScrollView'); +const React = require('react'); +const ReactTestRenderer = require('react-test-renderer'); describe('', () => { it('should render as expected', () => { diff --git a/Libraries/Components/Slider/Slider.js b/Libraries/Components/Slider/Slider.js index c3aee2d2d3d..ad5900f0e96 100644 --- a/Libraries/Components/Slider/Slider.js +++ b/Libraries/Components/Slider/Slider.js @@ -8,18 +8,18 @@ * @flow strict-local */ -import * as React from 'react'; -import Platform from '../../Utilities/Platform'; -import SliderNativeComponent from './SliderNativeComponent'; -import StyleSheet, { - type ViewStyleProp, - type ColorValue, -} from '../../StyleSheet/StyleSheet'; - import type {ImageSource} from '../../Image/ImageSource'; -import type {ViewProps} from '../View/ViewPropTypes'; import type {SyntheticEvent} from '../../Types/CoreEventTypes'; import type {AccessibilityState} from '../View/ViewAccessibility'; +import type {ViewProps} from '../View/ViewPropTypes'; + +import StyleSheet, { + type ColorValue, + type ViewStyleProp, +} from '../../StyleSheet/StyleSheet'; +import Platform from '../../Utilities/Platform'; +import SliderNativeComponent from './SliderNativeComponent'; +import * as React from 'react'; type Event = SyntheticEvent< $ReadOnly<{| diff --git a/Libraries/Components/Slider/SliderNativeComponent.js b/Libraries/Components/Slider/SliderNativeComponent.js index 9846c1a9ded..4e4e12cd8d9 100644 --- a/Libraries/Components/Slider/SliderNativeComponent.js +++ b/Libraries/Components/Slider/SliderNativeComponent.js @@ -8,19 +8,18 @@ * @flow strict-local */ +import type {ImageSource} from '../../Image/ImageSource'; +import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; +import type {ColorValue} from '../../StyleSheet/StyleSheet'; import type { BubblingEventHandler, DirectEventHandler, Double, WithDefault, } from '../../Types/CodegenTypes'; +import type {ViewProps} from '../View/ViewPropTypes'; import codegenNativeComponent from '../../Utilities/codegenNativeComponent'; -import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; - -import type {ColorValue} from '../../StyleSheet/StyleSheet'; -import type {ImageSource} from '../../Image/ImageSource'; -import type {ViewProps} from '../View/ViewPropTypes'; type Event = $ReadOnly<{| value: Double, diff --git a/Libraries/Components/Sound/NativeSoundManager.js b/Libraries/Components/Sound/NativeSoundManager.js index 1abf8c82bb3..425a3c3b835 100644 --- a/Libraries/Components/Sound/NativeSoundManager.js +++ b/Libraries/Components/Sound/NativeSoundManager.js @@ -9,6 +9,7 @@ */ import type {TurboModule} from '../../TurboModule/RCTExport'; + import * as TurboModuleRegistry from '../../TurboModule/TurboModuleRegistry'; /** diff --git a/Libraries/Components/StatusBar/NativeStatusBarManagerAndroid.js b/Libraries/Components/StatusBar/NativeStatusBarManagerAndroid.js index 4e13d10ba7b..acebb6ca3bd 100644 --- a/Libraries/Components/StatusBar/NativeStatusBarManagerAndroid.js +++ b/Libraries/Components/StatusBar/NativeStatusBarManagerAndroid.js @@ -9,6 +9,7 @@ */ import type {TurboModule} from '../../TurboModule/RCTExport'; + import * as TurboModuleRegistry from '../../TurboModule/TurboModuleRegistry'; export interface Spec extends TurboModule { diff --git a/Libraries/Components/StatusBar/NativeStatusBarManagerIOS.js b/Libraries/Components/StatusBar/NativeStatusBarManagerIOS.js index 6218a70bc5b..4ca0011b8a4 100644 --- a/Libraries/Components/StatusBar/NativeStatusBarManagerIOS.js +++ b/Libraries/Components/StatusBar/NativeStatusBarManagerIOS.js @@ -9,6 +9,7 @@ */ import type {TurboModule} from '../../TurboModule/RCTExport'; + import * as TurboModuleRegistry from '../../TurboModule/TurboModuleRegistry'; export interface Spec extends TurboModule { diff --git a/Libraries/Components/StatusBar/StatusBar.js b/Libraries/Components/StatusBar/StatusBar.js index 813146ddfdf..9110827229c 100644 --- a/Libraries/Components/StatusBar/StatusBar.js +++ b/Libraries/Components/StatusBar/StatusBar.js @@ -8,14 +8,14 @@ * @flow */ -import * as React from 'react'; -import Platform from '../../Utilities/Platform'; -import invariant from 'invariant'; -import processColor from '../../StyleSheet/processColor'; import type {ColorValue} from '../../StyleSheet/StyleSheet'; +import processColor from '../../StyleSheet/processColor'; +import Platform from '../../Utilities/Platform'; import NativeStatusBarManagerAndroid from './NativeStatusBarManagerAndroid'; import NativeStatusBarManagerIOS from './NativeStatusBarManagerIOS'; +import invariant from 'invariant'; +import * as React from 'react'; /** * Status bar style diff --git a/Libraries/Components/StatusBar/__tests__/StatusBar-test.js b/Libraries/Components/StatusBar/__tests__/StatusBar-test.js index bb2689d5d6a..6ff15085215 100644 --- a/Libraries/Components/StatusBar/__tests__/StatusBar-test.js +++ b/Libraries/Components/StatusBar/__tests__/StatusBar-test.js @@ -10,11 +10,10 @@ 'use strict'; +const StatusBar = require('../StatusBar'); const React = require('react'); const ReactTestRenderer = require('react-test-renderer'); -const StatusBar = require('../StatusBar'); - describe('StatusBar', () => { it('renders the statusbar', () => { const component = ReactTestRenderer.create(); diff --git a/Libraries/Components/Switch/AndroidSwitchNativeComponent.js b/Libraries/Components/Switch/AndroidSwitchNativeComponent.js index c2980101cc4..91a5951690d 100644 --- a/Libraries/Components/Switch/AndroidSwitchNativeComponent.js +++ b/Libraries/Components/Switch/AndroidSwitchNativeComponent.js @@ -8,16 +8,14 @@ * @format */ -import * as React from 'react'; - -import type {WithDefault, BubblingEventHandler} from '../../Types/CodegenTypes'; +import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; +import type {ColorValue} from '../../StyleSheet/StyleSheet'; +import type {BubblingEventHandler, WithDefault} from '../../Types/CodegenTypes'; +import type {ViewProps} from '../View/ViewPropTypes'; import codegenNativeCommands from '../../Utilities/codegenNativeCommands'; import codegenNativeComponent from '../../Utilities/codegenNativeComponent'; -import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; - -import type {ColorValue} from '../../StyleSheet/StyleSheet'; -import type {ViewProps} from '../View/ViewPropTypes'; +import * as React from 'react'; type SwitchChangeEvent = $ReadOnly<{| value: boolean, diff --git a/Libraries/Components/Switch/Switch.js b/Libraries/Components/Switch/Switch.js index a87a4a3fe94..a25f60efcb9 100644 --- a/Libraries/Components/Switch/Switch.js +++ b/Libraries/Components/Switch/Switch.js @@ -9,21 +9,20 @@ * @generate-docs */ -import Platform from '../../Utilities/Platform'; -import * as React from 'react'; -import StyleSheet from '../../StyleSheet/StyleSheet'; -import useMergeRefs from '../../Utilities/useMergeRefs'; +import type {ColorValue} from '../../StyleSheet/StyleSheet'; +import type {SyntheticEvent} from '../../Types/CoreEventTypes'; +import type {ViewProps} from '../View/ViewPropTypes'; +import StyleSheet from '../../StyleSheet/StyleSheet'; +import Platform from '../../Utilities/Platform'; +import useMergeRefs from '../../Utilities/useMergeRefs'; import AndroidSwitchNativeComponent, { Commands as AndroidSwitchCommands, } from './AndroidSwitchNativeComponent'; import SwitchNativeComponent, { Commands as SwitchCommands, } from './SwitchNativeComponent'; - -import type {ColorValue} from '../../StyleSheet/StyleSheet'; -import type {SyntheticEvent} from '../../Types/CoreEventTypes'; -import type {ViewProps} from '../View/ViewPropTypes'; +import * as React from 'react'; type SwitchChangeEvent = SyntheticEvent< $ReadOnly<{| diff --git a/Libraries/Components/Switch/SwitchNativeComponent.js b/Libraries/Components/Switch/SwitchNativeComponent.js index 55dbe218247..04d9cc83e20 100644 --- a/Libraries/Components/Switch/SwitchNativeComponent.js +++ b/Libraries/Components/Switch/SwitchNativeComponent.js @@ -8,14 +8,14 @@ * @format */ -import type {BubblingEventHandler, WithDefault} from '../../Types/CodegenTypes'; -import type {ColorValue} from '../../StyleSheet/StyleSheet'; -import type {ViewProps} from '../View/ViewPropTypes'; -import * as React from 'react'; - -import codegenNativeComponent from '../../Utilities/codegenNativeComponent'; -import codegenNativeCommands from '../../Utilities/codegenNativeCommands'; import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; +import type {ColorValue} from '../../StyleSheet/StyleSheet'; +import type {BubblingEventHandler, WithDefault} from '../../Types/CodegenTypes'; +import type {ViewProps} from '../View/ViewPropTypes'; + +import codegenNativeCommands from '../../Utilities/codegenNativeCommands'; +import codegenNativeComponent from '../../Utilities/codegenNativeComponent'; +import * as React from 'react'; type SwitchChangeEvent = $ReadOnly<{| value: boolean, diff --git a/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js b/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js index e12b1ad054c..faec7943692 100644 --- a/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +++ b/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js @@ -8,7 +8,15 @@ * @format */ -import type {ViewProps} from '../View/ViewPropTypes'; +import type { + HostComponent, + PartialViewConfig, +} from '../../Renderer/shims/ReactNativeTypes'; +import type { + ColorValue, + TextStyleProp, + ViewStyleProp, +} from '../../StyleSheet/StyleSheet'; import type { BubblingEventHandler, DirectEventHandler, @@ -17,18 +25,11 @@ import type { Int32, WithDefault, } from '../../Types/CodegenTypes'; -import type { - HostComponent, - PartialViewConfig, -} from '../../Renderer/shims/ReactNativeTypes'; -import type { - TextStyleProp, - ViewStyleProp, - ColorValue, -} from '../../StyleSheet/StyleSheet'; -import codegenNativeCommands from '../../Utilities/codegenNativeCommands'; +import type {ViewProps} from '../View/ViewPropTypes'; import type {TextInputNativeCommands} from './TextInputNativeCommands'; + import * as NativeComponentRegistry from '../../NativeComponent/NativeComponentRegistry'; +import codegenNativeCommands from '../../Utilities/codegenNativeCommands'; export type KeyboardType = // Cross Platform diff --git a/Libraries/Components/TextInput/InputAccessoryView.js b/Libraries/Components/TextInput/InputAccessoryView.js index 598155f2a3d..792474779f4 100644 --- a/Libraries/Components/TextInput/InputAccessoryView.js +++ b/Libraries/Components/TextInput/InputAccessoryView.js @@ -8,14 +8,13 @@ * @format */ -import * as React from 'react'; -import Platform from '../../Utilities/Platform'; import StyleSheet, { - type ViewStyleProp, type ColorValue, + type ViewStyleProp, } from '../../StyleSheet/StyleSheet'; - +import Platform from '../../Utilities/Platform'; import RCTInputAccessoryViewNativeComponent from './RCTInputAccessoryViewNativeComponent'; +import * as React from 'react'; /** * Note: iOS only diff --git a/Libraries/Components/TextInput/RCTInputAccessoryViewNativeComponent.js b/Libraries/Components/TextInput/RCTInputAccessoryViewNativeComponent.js index f9e7508501c..48432dbdd2c 100644 --- a/Libraries/Components/TextInput/RCTInputAccessoryViewNativeComponent.js +++ b/Libraries/Components/TextInput/RCTInputAccessoryViewNativeComponent.js @@ -8,11 +8,11 @@ * @format */ +import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; import type {ColorValue} from '../../StyleSheet/StyleSheet'; import type {ViewProps} from '../View/ViewPropTypes'; import codegenNativeComponent from '../../Utilities/codegenNativeComponent'; -import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; type NativeProps = $ReadOnly<{| ...ViewProps, diff --git a/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js b/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js index 9c42d59cacb..ccccc928a05 100644 --- a/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js +++ b/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js @@ -12,10 +12,11 @@ import type { HostComponent, PartialViewConfig, } from '../../Renderer/shims/ReactNativeTypes'; -import codegenNativeCommands from '../../Utilities/codegenNativeCommands'; import type {TextInputNativeCommands} from './TextInputNativeCommands'; -import RCTTextInputViewConfig from './RCTTextInputViewConfig'; + import * as NativeComponentRegistry from '../../NativeComponent/NativeComponentRegistry'; +import codegenNativeCommands from '../../Utilities/codegenNativeCommands'; +import RCTTextInputViewConfig from './RCTTextInputViewConfig'; type NativeType = HostComponent; diff --git a/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js b/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js index dfc01c34c54..8ec1f49441c 100644 --- a/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js +++ b/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js @@ -12,10 +12,11 @@ import type { HostComponent, PartialViewConfig, } from '../../Renderer/shims/ReactNativeTypes'; -import codegenNativeCommands from '../../Utilities/codegenNativeCommands'; import type {TextInputNativeCommands} from './TextInputNativeCommands'; -import RCTTextInputViewConfig from './RCTTextInputViewConfig'; + import * as NativeComponentRegistry from '../../NativeComponent/NativeComponentRegistry'; +import codegenNativeCommands from '../../Utilities/codegenNativeCommands'; +import RCTTextInputViewConfig from './RCTTextInputViewConfig'; type NativeType = HostComponent; diff --git a/Libraries/Components/TextInput/RCTTextInputViewConfig.js b/Libraries/Components/TextInput/RCTTextInputViewConfig.js index 68ee77143d1..1962d095693 100644 --- a/Libraries/Components/TextInput/RCTTextInputViewConfig.js +++ b/Libraries/Components/TextInput/RCTTextInputViewConfig.js @@ -9,6 +9,7 @@ */ import type {PartialViewConfig} from '../../Renderer/shims/ReactNativeTypes'; + import {ConditionallyIgnoredEventHandlers} from '../../NativeComponent/ViewConfigIgnore'; type PartialViewConfigWithoutName = $Rest< diff --git a/Libraries/Components/TextInput/TextInput.flow.js b/Libraries/Components/TextInput/TextInput.flow.js index 6ab10861b68..10a53f155c0 100644 --- a/Libraries/Components/TextInput/TextInput.flow.js +++ b/Libraries/Components/TextInput/TextInput.flow.js @@ -8,20 +8,20 @@ * @format */ -import * as React from 'react'; +import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; +import type { + PressEvent, + ScrollEvent, + SyntheticEvent, +} from '../../Types/CoreEventTypes'; +import type {ViewProps} from '../View/ViewPropTypes'; import { + type ColorValue, type TextStyleProp, type ViewStyleProp, - type ColorValue, } from '../../StyleSheet/StyleSheet'; -import type {ViewProps} from '../View/ViewPropTypes'; -import type { - SyntheticEvent, - ScrollEvent, - PressEvent, -} from '../../Types/CoreEventTypes'; -import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; +import * as React from 'react'; type ComponentRef = React.ElementRef>; type ReactRefSetter = {current: null | T, ...} | ((ref: null | T) => mixed); diff --git a/Libraries/Components/TextInput/TextInput.js b/Libraries/Components/TextInput/TextInput.js index b212d07fa69..91b8e22f6d7 100644 --- a/Libraries/Components/TextInput/TextInput.js +++ b/Libraries/Components/TextInput/TextInput.js @@ -8,31 +8,29 @@ * @format */ -import * as React from 'react'; - -import Platform from '../../Utilities/Platform'; -import StyleSheet, { - type TextStyleProp, - type ViewStyleProp, - type ColorValue, -} from '../../StyleSheet/StyleSheet'; -import Text from '../../Text/Text'; -import TextAncestor from '../../Text/TextAncestor'; -import TextInputState from './TextInputState'; -import invariant from 'invariant'; -import nullthrows from 'nullthrows'; -import setAndForwardRef from '../../Utilities/setAndForwardRef'; +import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; +import type { + PressEvent, + ScrollEvent, + SyntheticEvent, +} from '../../Types/CoreEventTypes'; +import type {ViewProps} from '../View/ViewPropTypes'; import type {TextInputType} from './TextInput.flow'; import usePressability from '../../Pressability/usePressability'; - -import type {ViewProps} from '../View/ViewPropTypes'; -import type { - SyntheticEvent, - ScrollEvent, - PressEvent, -} from '../../Types/CoreEventTypes'; -import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; +import StyleSheet, { + type ColorValue, + type TextStyleProp, + type ViewStyleProp, +} from '../../StyleSheet/StyleSheet'; +import Text from '../../Text/Text'; +import TextAncestor from '../../Text/TextAncestor'; +import Platform from '../../Utilities/Platform'; +import setAndForwardRef from '../../Utilities/setAndForwardRef'; +import TextInputState from './TextInputState'; +import invariant from 'invariant'; +import nullthrows from 'nullthrows'; +import * as React from 'react'; const {useLayoutEffect, useRef, useState} = React; diff --git a/Libraries/Components/TextInput/TextInputNativeCommands.js b/Libraries/Components/TextInput/TextInputNativeCommands.js index 560ae5bf8a3..e64262ae37d 100644 --- a/Libraries/Components/TextInput/TextInputNativeCommands.js +++ b/Libraries/Components/TextInput/TextInputNativeCommands.js @@ -8,10 +8,10 @@ * @format */ -import * as React from 'react'; - import type {Int32} from '../../Types/CodegenTypes'; +import * as React from 'react'; + export interface TextInputNativeCommands { +focus: (viewRef: React.ElementRef) => void; +blur: (viewRef: React.ElementRef) => void; diff --git a/Libraries/Components/TextInput/TextInputState.js b/Libraries/Components/TextInput/TextInputState.js index 10c300bed1b..b47c5489a65 100644 --- a/Libraries/Components/TextInput/TextInputState.js +++ b/Libraries/Components/TextInput/TextInputState.js @@ -12,13 +12,14 @@ // TextInputs. All calls relating to the keyboard should be funneled // through here. -const React = require('react'); -const Platform = require('../../Utilities/Platform'); -const {findNodeHandle} = require('../../ReactNative/RendererProxy'); +import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; + import {Commands as AndroidTextInputCommands} from '../../Components/TextInput/AndroidTextInputNativeComponent'; import {Commands as iOSTextInputCommands} from '../../Components/TextInput/RCTSingelineTextInputNativeComponent'; -import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; +const {findNodeHandle} = require('../../ReactNative/RendererProxy'); +const Platform = require('../../Utilities/Platform'); +const React = require('react'); type ComponentRef = React.ElementRef>; let currentlyFocusedInputRef: ?ComponentRef = null; diff --git a/Libraries/Components/TextInput/__tests__/InputAccessoryView-test.js b/Libraries/Components/TextInput/__tests__/InputAccessoryView-test.js index 72b3136e604..d293702660a 100644 --- a/Libraries/Components/TextInput/__tests__/InputAccessoryView-test.js +++ b/Libraries/Components/TextInput/__tests__/InputAccessoryView-test.js @@ -11,10 +11,10 @@ 'use strict'; -const React = require('react'); +const render = require('../../../../jest/renderer'); const View = require('../../View/View'); const InputAccessoryView = require('../InputAccessoryView'); -const render = require('../../../../jest/renderer'); +const React = require('react'); describe('', () => { it('should render as when mocked', () => { diff --git a/Libraries/Components/TextInput/__tests__/TextInput-test.js b/Libraries/Components/TextInput/__tests__/TextInput-test.js index e1b028ed97e..40c34cb872e 100644 --- a/Libraries/Components/TextInput/__tests__/TextInput-test.js +++ b/Libraries/Components/TextInput/__tests__/TextInput-test.js @@ -9,15 +9,14 @@ * @oncall react_native */ -const React = require('react'); -const ReactTestRenderer = require('react-test-renderer'); -const TextInput = require('../TextInput'); const ReactNative = require('../../../ReactNative/RendererProxy'); - const { enter, expectRendersMatchingSnapshot, } = require('../../../Utilities/ReactNativeTestTools'); +const TextInput = require('../TextInput'); +const React = require('react'); +const ReactTestRenderer = require('react-test-renderer'); jest.unmock('../TextInput'); diff --git a/Libraries/Components/ToastAndroid/NativeToastAndroid.js b/Libraries/Components/ToastAndroid/NativeToastAndroid.js index b35757b25d4..3a13f89bd45 100644 --- a/Libraries/Components/ToastAndroid/NativeToastAndroid.js +++ b/Libraries/Components/ToastAndroid/NativeToastAndroid.js @@ -9,6 +9,7 @@ */ import type {TurboModule} from '../../TurboModule/RCTExport'; + import * as TurboModuleRegistry from '../../TurboModule/TurboModuleRegistry'; export interface Spec extends TurboModule { diff --git a/Libraries/Components/Touchable/Touchable.flow.js b/Libraries/Components/Touchable/Touchable.flow.js index f88f2d61807..3a583c286df 100644 --- a/Libraries/Components/Touchable/Touchable.flow.js +++ b/Libraries/Components/Touchable/Touchable.flow.js @@ -8,12 +8,12 @@ * @format */ -import * as React from 'react'; - -import type {ColorValue} from '../../StyleSheet/StyleSheet'; import type {EdgeInsetsProp} from '../../StyleSheet/EdgeInsetsPropType'; +import type {ColorValue} from '../../StyleSheet/StyleSheet'; import type {PressEvent} from '../../Types/CoreEventTypes'; +import * as React from 'react'; + /** * `Touchable`: Taps done right. * diff --git a/Libraries/Components/Touchable/Touchable.js b/Libraries/Components/Touchable/Touchable.js index 553566d1bbd..48e15bf1b6d 100644 --- a/Libraries/Components/Touchable/Touchable.js +++ b/Libraries/Components/Touchable/Touchable.js @@ -8,19 +8,18 @@ * @format */ -import * as React from 'react'; -import BoundingDimensions from './BoundingDimensions'; -import Platform from '../../Utilities/Platform'; -import Position from './Position'; -import UIManager from '../../ReactNative/UIManager'; -import SoundManager from '../Sound/SoundManager'; +import type {EdgeInsetsProp} from '../../StyleSheet/EdgeInsetsPropType'; +import type {ColorValue} from '../../StyleSheet/StyleSheet'; +import type {PressEvent} from '../../Types/CoreEventTypes'; import type {TouchableType} from './Touchable.flow'; import {PressabilityDebugView} from '../../Pressability/PressabilityDebug'; - -import type {ColorValue} from '../../StyleSheet/StyleSheet'; -import type {EdgeInsetsProp} from '../../StyleSheet/EdgeInsetsPropType'; -import type {PressEvent} from '../../Types/CoreEventTypes'; +import UIManager from '../../ReactNative/UIManager'; +import Platform from '../../Utilities/Platform'; +import SoundManager from '../Sound/SoundManager'; +import BoundingDimensions from './BoundingDimensions'; +import Position from './Position'; +import * as React from 'react'; const extractSingleTouch = (nativeEvent: { +changedTouches: $ReadOnlyArray, diff --git a/Libraries/Components/Touchable/TouchableBounce.js b/Libraries/Components/Touchable/TouchableBounce.js index ea512bad3eb..5a8d97e85c0 100644 --- a/Libraries/Components/Touchable/TouchableBounce.js +++ b/Libraries/Components/Touchable/TouchableBounce.js @@ -8,13 +8,14 @@ * @format */ +import type {ViewStyleProp} from '../../StyleSheet/StyleSheet'; +import typeof TouchableWithoutFeedback from './TouchableWithoutFeedback'; + +import Animated from '../../Animated/Animated'; import Pressability, { type PressabilityConfig, } from '../../Pressability/Pressability'; import {PressabilityDebugView} from '../../Pressability/PressabilityDebug'; -import type {ViewStyleProp} from '../../StyleSheet/StyleSheet'; -import typeof TouchableWithoutFeedback from './TouchableWithoutFeedback'; -import Animated from '../../Animated/Animated'; import Platform from '../../Utilities/Platform'; import * as React from 'react'; diff --git a/Libraries/Components/Touchable/TouchableHighlight.js b/Libraries/Components/Touchable/TouchableHighlight.js index 7aa8d6be1fb..7d648ca83a9 100644 --- a/Libraries/Components/Touchable/TouchableHighlight.js +++ b/Libraries/Components/Touchable/TouchableHighlight.js @@ -8,15 +8,16 @@ * @format */ +import type {ColorValue} from '../../StyleSheet/StyleSheet'; +import typeof TouchableWithoutFeedback from './TouchableWithoutFeedback'; + +import View from '../../Components/View/View'; import Pressability, { type PressabilityConfig, } from '../../Pressability/Pressability'; import {PressabilityDebugView} from '../../Pressability/PressabilityDebug'; import StyleSheet, {type ViewStyleProp} from '../../StyleSheet/StyleSheet'; -import type {ColorValue} from '../../StyleSheet/StyleSheet'; -import typeof TouchableWithoutFeedback from './TouchableWithoutFeedback'; import Platform from '../../Utilities/Platform'; -import View from '../../Components/View/View'; import * as React from 'react'; type AndroidProps = $ReadOnly<{| diff --git a/Libraries/Components/Touchable/TouchableNativeFeedback.js b/Libraries/Components/Touchable/TouchableNativeFeedback.js index ff7b8f3b421..a377694e06c 100644 --- a/Libraries/Components/Touchable/TouchableNativeFeedback.js +++ b/Libraries/Components/Touchable/TouchableNativeFeedback.js @@ -8,19 +8,20 @@ * @format */ +import type {PressEvent} from '../../Types/CoreEventTypes'; +import typeof TouchableWithoutFeedback from './TouchableWithoutFeedback'; + +import View from '../../Components/View/View'; import Pressability, { type PressabilityConfig, } from '../../Pressability/Pressability'; import {PressabilityDebugView} from '../../Pressability/PressabilityDebug'; -import typeof TouchableWithoutFeedback from './TouchableWithoutFeedback'; -import {Commands} from '../View/ViewNativeComponent'; import {findHostInstance_DEPRECATED} from '../../ReactNative/RendererProxy'; -import type {PressEvent} from '../../Types/CoreEventTypes'; -import Platform from '../../Utilities/Platform'; -import View from '../../Components/View/View'; import processColor from '../../StyleSheet/processColor'; -import * as React from 'react'; +import Platform from '../../Utilities/Platform'; +import {Commands} from '../View/ViewNativeComponent'; import invariant from 'invariant'; +import * as React from 'react'; type Props = $ReadOnly<{| ...React.ElementConfig, diff --git a/Libraries/Components/Touchable/TouchableOpacity.js b/Libraries/Components/Touchable/TouchableOpacity.js index 5809514533e..2aef4e824f1 100644 --- a/Libraries/Components/Touchable/TouchableOpacity.js +++ b/Libraries/Components/Touchable/TouchableOpacity.js @@ -8,14 +8,15 @@ * @format */ +import type {ViewStyleProp} from '../../StyleSheet/StyleSheet'; +import typeof TouchableWithoutFeedback from './TouchableWithoutFeedback'; + +import Animated from '../../Animated/Animated'; +import Easing from '../../Animated/Easing'; import Pressability, { type PressabilityConfig, } from '../../Pressability/Pressability'; import {PressabilityDebugView} from '../../Pressability/PressabilityDebug'; -import typeof TouchableWithoutFeedback from './TouchableWithoutFeedback'; -import Animated from '../../Animated/Animated'; -import Easing from '../../Animated/Easing'; -import type {ViewStyleProp} from '../../StyleSheet/StyleSheet'; import flattenStyle from '../../StyleSheet/flattenStyle'; import Platform from '../../Utilities/Platform'; import * as React from 'react'; diff --git a/Libraries/Components/Touchable/TouchableWithoutFeedback.js b/Libraries/Components/Touchable/TouchableWithoutFeedback.js index bdffe2b1ee3..0fd50298d20 100755 --- a/Libraries/Components/Touchable/TouchableWithoutFeedback.js +++ b/Libraries/Components/Touchable/TouchableWithoutFeedback.js @@ -8,10 +8,6 @@ * @format */ -import Pressability, { - type PressabilityConfig, -} from '../../Pressability/Pressability'; -import {PressabilityDebugView} from '../../Pressability/PressabilityDebug'; import type { AccessibilityActionEvent, AccessibilityActionInfo, @@ -26,7 +22,12 @@ import type { LayoutEvent, PressEvent, } from '../../Types/CoreEventTypes'; + import View from '../../Components/View/View'; +import Pressability, { + type PressabilityConfig, +} from '../../Pressability/Pressability'; +import {PressabilityDebugView} from '../../Pressability/PressabilityDebug'; import * as React from 'react'; type Props = $ReadOnly<{| diff --git a/Libraries/Components/Touchable/__tests__/TouchableHighlight-test.js b/Libraries/Components/Touchable/__tests__/TouchableHighlight-test.js index e760fc27f4e..024feffaa29 100644 --- a/Libraries/Components/Touchable/__tests__/TouchableHighlight-test.js +++ b/Libraries/Components/Touchable/__tests__/TouchableHighlight-test.js @@ -10,10 +10,10 @@ 'use strict'; -import * as React from 'react'; import Text from '../../../Text/Text'; import View from '../../View/View'; import TouchableHighlight from '../TouchableHighlight'; +import * as React from 'react'; const render = require('../../../../jest/renderer'); diff --git a/Libraries/Components/Touchable/__tests__/TouchableNativeFeedback-test.js b/Libraries/Components/Touchable/__tests__/TouchableNativeFeedback-test.js index 50c453c7461..377c4f37376 100644 --- a/Libraries/Components/Touchable/__tests__/TouchableNativeFeedback-test.js +++ b/Libraries/Components/Touchable/__tests__/TouchableNativeFeedback-test.js @@ -10,11 +10,11 @@ 'use strict'; +import Text from '../../../Text/Text'; +import View from '../../View/View'; +import TouchableNativeFeedback from '../TouchableNativeFeedback'; import * as React from 'react'; import ReactTestRenderer from 'react-test-renderer'; -import Text from '../../../Text/Text'; -import TouchableNativeFeedback from '../TouchableNativeFeedback'; -import View from '../../View/View'; const render = require('../../../../jest/renderer'); diff --git a/Libraries/Components/Touchable/__tests__/TouchableOpacity-test.js b/Libraries/Components/Touchable/__tests__/TouchableOpacity-test.js index a3178b3f035..8f4f4f2f6bc 100644 --- a/Libraries/Components/Touchable/__tests__/TouchableOpacity-test.js +++ b/Libraries/Components/Touchable/__tests__/TouchableOpacity-test.js @@ -10,10 +10,10 @@ 'use strict'; -const React = require('react'); -const ReactTestRenderer = require('react-test-renderer'); const Text = require('../../../Text/Text'); const TouchableOpacity = require('../TouchableOpacity'); +const React = require('react'); +const ReactTestRenderer = require('react-test-renderer'); describe('TouchableOpacity', () => { it('renders correctly', () => { diff --git a/Libraries/Components/Touchable/__tests__/TouchableWithoutFeedback-test.js b/Libraries/Components/Touchable/__tests__/TouchableWithoutFeedback-test.js index 15e1ce66f3d..4e1f12d4575 100644 --- a/Libraries/Components/Touchable/__tests__/TouchableWithoutFeedback-test.js +++ b/Libraries/Components/Touchable/__tests__/TouchableWithoutFeedback-test.js @@ -10,11 +10,11 @@ 'use strict'; -import * as React from 'react'; -import ReactTestRenderer from 'react-test-renderer'; import Text from '../../../Text/Text'; import View from '../../View/View'; import TouchableWithoutFeedback from '../TouchableWithoutFeedback'; +import * as React from 'react'; +import ReactTestRenderer from 'react-test-renderer'; describe('TouchableWithoutFeedback', () => { it('renders correctly', () => { diff --git a/Libraries/Components/UnimplementedViews/UnimplementedNativeViewNativeComponent.js b/Libraries/Components/UnimplementedViews/UnimplementedNativeViewNativeComponent.js index 89e2d42f2e1..3c972820c54 100644 --- a/Libraries/Components/UnimplementedViews/UnimplementedNativeViewNativeComponent.js +++ b/Libraries/Components/UnimplementedViews/UnimplementedNativeViewNativeComponent.js @@ -8,11 +8,11 @@ * @flow strict-local */ +import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; import type {WithDefault} from '../../Types/CodegenTypes'; import type {ViewProps} from '../View/ViewPropTypes'; import codegenNativeComponent from '../../Utilities/codegenNativeComponent'; -import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; type NativeProps = $ReadOnly<{| ...ViewProps, diff --git a/Libraries/Components/UnimplementedViews/UnimplementedView.js b/Libraries/Components/UnimplementedViews/UnimplementedView.js index 24a6e3a51c4..3c884ad3f6c 100644 --- a/Libraries/Components/UnimplementedViews/UnimplementedView.js +++ b/Libraries/Components/UnimplementedViews/UnimplementedView.js @@ -9,8 +9,8 @@ */ 'use strict'; -import * as React from 'react'; import StyleSheet from '../../StyleSheet/StyleSheet'; +import * as React from 'react'; /** * Common implementation for a simple stubbed view. Simply applies the view's styles to the inner diff --git a/Libraries/Components/View/ReactNativeStyleAttributes.js b/Libraries/Components/View/ReactNativeStyleAttributes.js index e83109fc925..1c1818fa522 100644 --- a/Libraries/Components/View/ReactNativeStyleAttributes.js +++ b/Libraries/Components/View/ReactNativeStyleAttributes.js @@ -9,6 +9,7 @@ */ import type {AnyAttributeType} from '../../Renderer/shims/ReactNativeTypes'; + import processAspectRatio from '../../StyleSheet/processAspectRatio'; import processColor from '../../StyleSheet/processColor'; import processFontVariant from '../../StyleSheet/processFontVariant'; diff --git a/Libraries/Components/View/View.js b/Libraries/Components/View/View.js index 6558441bd5f..feb9b207923 100644 --- a/Libraries/Components/View/View.js +++ b/Libraries/Components/View/View.js @@ -10,9 +10,9 @@ import type {ViewProps} from './ViewPropTypes'; -import ViewNativeComponent from './ViewNativeComponent'; -import TextAncestor from '../../Text/TextAncestor'; import flattenStyle from '../../StyleSheet/flattenStyle'; +import TextAncestor from '../../Text/TextAncestor'; +import ViewNativeComponent from './ViewNativeComponent'; import * as React from 'react'; export type Props = ViewProps; diff --git a/Libraries/Components/View/ViewNativeComponent.js b/Libraries/Components/View/ViewNativeComponent.js index bba9f3971e6..7f41843de77 100644 --- a/Libraries/Components/View/ViewNativeComponent.js +++ b/Libraries/Components/View/ViewNativeComponent.js @@ -8,15 +8,15 @@ * @format */ -import * as NativeComponentRegistry from '../../NativeComponent/NativeComponentRegistry'; import type { HostComponent, PartialViewConfig, } from '../../Renderer/shims/ReactNativeTypes'; -import codegenNativeCommands from '../../Utilities/codegenNativeCommands'; -import {type ViewProps as Props} from './ViewPropTypes'; -import Platform from '../../Utilities/Platform'; +import * as NativeComponentRegistry from '../../NativeComponent/NativeComponentRegistry'; +import codegenNativeCommands from '../../Utilities/codegenNativeCommands'; +import Platform from '../../Utilities/Platform'; +import {type ViewProps as Props} from './ViewPropTypes'; import * as React from 'react'; export const __INTERNAL_VIEW_CONFIG: PartialViewConfig = diff --git a/Libraries/Components/View/ViewPropTypes.js b/Libraries/Components/View/ViewPropTypes.js index c9939c3ed39..f25e9481ed3 100644 --- a/Libraries/Components/View/ViewPropTypes.js +++ b/Libraries/Components/View/ViewPropTypes.js @@ -10,26 +10,26 @@ 'use strict'; +import type {EdgeInsetsOrSizeProp} from '../../StyleSheet/EdgeInsetsPropType'; +import type {ViewStyleProp} from '../../StyleSheet/StyleSheet'; import type { BlurEvent, FocusEvent, + Layout, + LayoutEvent, MouseEvent, PointerEvent, PressEvent, - Layout, - LayoutEvent, } from '../../Types/CoreEventTypes'; -import type {EdgeInsetsOrSizeProp} from '../../StyleSheet/EdgeInsetsPropType'; -import type {Node} from 'react'; -import type {ViewStyleProp} from '../../StyleSheet/StyleSheet'; import type { - Role, + AccessibilityActionEvent, + AccessibilityActionInfo, AccessibilityRole, AccessibilityState, AccessibilityValue, - AccessibilityActionEvent, - AccessibilityActionInfo, + Role, } from './ViewAccessibility'; +import type {Node} from 'react'; export type ViewLayout = Layout; export type ViewLayoutEvent = LayoutEvent; diff --git a/Libraries/Components/__tests__/Button-test.js b/Libraries/Components/__tests__/Button-test.js index 3c370b4e36b..8ecd5f7f6a6 100644 --- a/Libraries/Components/__tests__/Button-test.js +++ b/Libraries/Components/__tests__/Button-test.js @@ -5,9 +5,9 @@ * LICENSE file in the root directory of this source tree. */ +import Button from '../Button'; import * as React from 'react'; import ReactTestRenderer from 'react-test-renderer'; -import Button from '../Button'; describe('