diff --git a/packages/react-native/Libraries/ReactNative/getNativeComponentAttributes.js b/packages/react-native/Libraries/ReactNative/getNativeComponentAttributes.js index 2af83f4c4e5298..aae2d4d6796700 100644 --- a/packages/react-native/Libraries/ReactNative/getNativeComponentAttributes.js +++ b/packages/react-native/Libraries/ReactNative/getNativeComponentAttributes.js @@ -17,7 +17,7 @@ const resolveAssetSource = require('../Image/resolveAssetSource'); const processBackgroundImage = require('../StyleSheet/processBackgroundImage').default; const processColor = require('../StyleSheet/processColor').default; -const processColorArray = require('../StyleSheet/processColorArray'); +const processColorArray = require('../StyleSheet/processColorArray').default; const processFilter = require('../StyleSheet/processFilter').default; const insetsDiffer = require('../Utilities/differ/insetsDiffer'); const matricesDiffer = require('../Utilities/differ/matricesDiffer'); diff --git a/packages/react-native/Libraries/StyleSheet/PlatformColorValueTypes.ios.js b/packages/react-native/Libraries/StyleSheet/PlatformColorValueTypes.ios.js index 418df65ac95837..ba38455fd96471 100644 --- a/packages/react-native/Libraries/StyleSheet/PlatformColorValueTypes.ios.js +++ b/packages/react-native/Libraries/StyleSheet/PlatformColorValueTypes.ios.js @@ -56,7 +56,7 @@ const _normalizeColorObject = ( // an ios semantic color return color; } else if ('dynamic' in color && color.dynamic !== undefined) { - const normalizeColor = require('./normalizeColor'); + const normalizeColor = require('./normalizeColor').default; // a dynamic, appearance aware color const dynamic = color.dynamic; diff --git a/packages/react-native/Libraries/StyleSheet/__flowtests__/StyleSheet-flowtest.js b/packages/react-native/Libraries/StyleSheet/__flowtests__/StyleSheet-flowtest.js index c8d564ac1c5f56..a8f3abb709e896 100644 --- a/packages/react-native/Libraries/StyleSheet/__flowtests__/StyleSheet-flowtest.js +++ b/packages/react-native/Libraries/StyleSheet/__flowtests__/StyleSheet-flowtest.js @@ -12,7 +12,8 @@ import type {ImageStyleProp, TextStyleProp} from '../StyleSheet'; -const StyleSheet = require('../StyleSheet'); +import StyleSheet from '../StyleSheet'; + const imageStyle = {tintColor: 'rgb(0, 0, 0)'}; const textStyle = {color: 'rgb(0, 0, 0)'}; diff --git a/packages/react-native/Libraries/StyleSheet/__tests__/processAspectRatio-test.js b/packages/react-native/Libraries/StyleSheet/__tests__/processAspectRatio-test.js index 1097d956203e12..95a089e8e370a6 100644 --- a/packages/react-native/Libraries/StyleSheet/__tests__/processAspectRatio-test.js +++ b/packages/react-native/Libraries/StyleSheet/__tests__/processAspectRatio-test.js @@ -10,7 +10,7 @@ 'use strict'; -const processAspectRatio = require('../processAspectRatio'); +import processAspectRatio from '../processAspectRatio'; describe('processAspectRatio', () => { it('should accept numbers', () => { diff --git a/packages/react-native/Libraries/StyleSheet/__tests__/processTransform-test.js b/packages/react-native/Libraries/StyleSheet/__tests__/processTransform-test.js index fe7c5d2851505f..a794c9a978ad29 100644 --- a/packages/react-native/Libraries/StyleSheet/__tests__/processTransform-test.js +++ b/packages/react-native/Libraries/StyleSheet/__tests__/processTransform-test.js @@ -10,7 +10,7 @@ 'use strict'; -const processTransform = require('../processTransform'); +import processTransform from '../processTransform'; describe('processTransform', () => { describe('validation', () => { diff --git a/packages/react-native/Libraries/StyleSheet/normalizeColor.js b/packages/react-native/Libraries/StyleSheet/normalizeColor.js index e181ec2892848e..0a565e83e01039 100755 --- a/packages/react-native/Libraries/StyleSheet/normalizeColor.js +++ b/packages/react-native/Libraries/StyleSheet/normalizeColor.js @@ -31,4 +31,4 @@ function normalizeColor( } } -module.exports = normalizeColor; +export default normalizeColor; diff --git a/packages/react-native/Libraries/StyleSheet/processAspectRatio.js b/packages/react-native/Libraries/StyleSheet/processAspectRatio.js index a47ee101bb50a2..6f5dce47bf1a9c 100644 --- a/packages/react-native/Libraries/StyleSheet/processAspectRatio.js +++ b/packages/react-native/Libraries/StyleSheet/processAspectRatio.js @@ -60,4 +60,4 @@ function processAspectRatio(aspectRatio?: number | string): ?number { return Number(matches[0]); } -module.exports = processAspectRatio; +export default processAspectRatio; diff --git a/packages/react-native/Libraries/StyleSheet/processColor.js b/packages/react-native/Libraries/StyleSheet/processColor.js index 2bac21b59bfbc5..d8d0e996d287da 100644 --- a/packages/react-native/Libraries/StyleSheet/processColor.js +++ b/packages/react-native/Libraries/StyleSheet/processColor.js @@ -13,7 +13,7 @@ import type {ColorValue, NativeColorValue} from './StyleSheet'; const Platform = require('../Utilities/Platform'); -const normalizeColor = require('./normalizeColor'); +const normalizeColor = require('./normalizeColor').default; export type ProcessedColorValue = number | NativeColorValue; diff --git a/packages/react-native/Libraries/StyleSheet/processColorArray.js b/packages/react-native/Libraries/StyleSheet/processColorArray.js index 7b3d53517ef157..7a0aade44b1d9e 100644 --- a/packages/react-native/Libraries/StyleSheet/processColorArray.js +++ b/packages/react-native/Libraries/StyleSheet/processColorArray.js @@ -32,4 +32,4 @@ function processColorElement(color: ColorValue): ProcessedColorValue { return value; } -module.exports = processColorArray; +export default processColorArray; diff --git a/packages/react-native/Libraries/StyleSheet/processFontVariant.js b/packages/react-native/Libraries/StyleSheet/processFontVariant.js index 32a72f879e6f9b..3019af2be5adb6 100644 --- a/packages/react-native/Libraries/StyleSheet/processFontVariant.js +++ b/packages/react-native/Libraries/StyleSheet/processFontVariant.js @@ -27,4 +27,4 @@ function processFontVariant( return match; } -module.exports = processFontVariant; +export default processFontVariant; diff --git a/packages/react-native/Libraries/StyleSheet/processTransform.js b/packages/react-native/Libraries/StyleSheet/processTransform.js index 8338e4f06d2b77..79cfdaeb33f2a0 100644 --- a/packages/react-native/Libraries/StyleSheet/processTransform.js +++ b/packages/react-native/Libraries/StyleSheet/processTransform.js @@ -266,4 +266,4 @@ function _validateTransform( } } -module.exports = processTransform; +export default processTransform; diff --git a/packages/react-native/Libraries/StyleSheet/setNormalizedColorAlpha.js b/packages/react-native/Libraries/StyleSheet/setNormalizedColorAlpha.js index 7cfce2dc9fb80a..581cc33d7482ec 100644 --- a/packages/react-native/Libraries/StyleSheet/setNormalizedColorAlpha.js +++ b/packages/react-native/Libraries/StyleSheet/setNormalizedColorAlpha.js @@ -28,4 +28,4 @@ function setNormalizedColorAlpha(input: number, alpha: number): number { return ((input & 0xffffff00) | alpha) >>> 0; } -module.exports = setNormalizedColorAlpha; +export default setNormalizedColorAlpha; diff --git a/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap b/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap index ee3d98fe77041d..4aefa70d995706 100644 --- a/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap +++ b/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap @@ -8323,7 +8323,7 @@ exports[`public API should not change unintentionally Libraries/StyleSheet/norma "declare function normalizeColor( color: ?(ColorValue | ProcessedColorValue) ): ?ProcessedColorValue; -declare module.exports: normalizeColor; +declare export default typeof normalizeColor; " `; @@ -8371,7 +8371,7 @@ exports[`public API should not change unintentionally Libraries/StyleSheet/priva exports[`public API should not change unintentionally Libraries/StyleSheet/processAspectRatio.js 1`] = ` "declare function processAspectRatio(aspectRatio?: number | string): ?number; -declare module.exports: processAspectRatio; +declare export default typeof processAspectRatio; " `; @@ -8421,7 +8421,7 @@ exports[`public API should not change unintentionally Libraries/StyleSheet/proce "declare function processColorArray( colors: ?$ReadOnlyArray ): ?$ReadOnlyArray; -declare module.exports: processColorArray; +declare export default typeof processColorArray; " `; @@ -8453,7 +8453,7 @@ exports[`public API should not change unintentionally Libraries/StyleSheet/proce "declare function processFontVariant( fontVariant: ____FontVariantArray_Internal | string ): ?____FontVariantArray_Internal; -declare module.exports: processFontVariant; +declare export default typeof processFontVariant; " `; @@ -8461,7 +8461,7 @@ exports[`public API should not change unintentionally Libraries/StyleSheet/proce "declare function processTransform( transform: Array | string ): Array | Array; -declare module.exports: processTransform; +declare export default typeof processTransform; " `; @@ -8474,7 +8474,7 @@ exports[`public API should not change unintentionally Libraries/StyleSheet/proce exports[`public API should not change unintentionally Libraries/StyleSheet/setNormalizedColorAlpha.js 1`] = ` "declare function setNormalizedColorAlpha(input: number, alpha: number): number; -declare module.exports: setNormalizedColorAlpha; +declare export default typeof setNormalizedColorAlpha; " `;