Skip to content

Commit c9d7774

Browse files
pietervfacebook-github-bot
authored andcommitted
Cleanup imports and types (facebook#44862)
Summary: Pull Request resolved: facebook#44862 Clean up: * type imports to be consistent * Remove long since deprecated `{| ... |}` exact object style. Changelog: [Internal] Reviewed By: NickGerleman Differential Revision: D58381905 fbshipit-source-id: 4c061385a987a2bc7dd8339183533084f1efd699
1 parent 32c3cd3 commit c9d7774

File tree

3 files changed

+17
-16
lines changed

3 files changed

+17
-16
lines changed

packages/react-native/Libraries/Text/TextNativeComponent.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@
88
* @format
99
*/
1010

11+
import type {HostComponent} from '../Renderer/shims/ReactNativeTypes';
12+
import type {ProcessedColorValue} from '../StyleSheet/processColor';
13+
import type {PressEvent} from '../Types/CoreEventTypes';
14+
import type {TextProps} from './TextProps';
15+
1116
import {createViewConfig} from '../NativeComponent/ViewConfig';
1217
import UIManager from '../ReactNative/UIManager';
1318
import createReactNativeComponentClass from '../Renderer/shims/createReactNativeComponentClass';
14-
import {type HostComponent} from '../Renderer/shims/ReactNativeTypes';
15-
import {type ProcessedColorValue} from '../StyleSheet/processColor';
16-
import {type PressEvent} from '../Types/CoreEventTypes';
17-
import {type TextProps} from './TextProps';
1819

1920
type NativeTextProps = $ReadOnly<{
2021
...TextProps,

packages/react-native/Libraries/Text/TextProps.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,23 @@ import type {
2626
} from '../Types/CoreEventTypes';
2727
import type {Node} from 'react';
2828

29-
export type PressRetentionOffset = $ReadOnly<{|
29+
export type PressRetentionOffset = $ReadOnly<{
3030
top: number,
3131
left: number,
3232
bottom: number,
3333
right: number,
34-
|}>;
34+
}>;
3535

36-
type PointerEventProps = $ReadOnly<{|
36+
type PointerEventProps = $ReadOnly<{
3737
onPointerEnter?: (event: PointerEvent) => void,
3838
onPointerLeave?: (event: PointerEvent) => void,
3939
onPointerMove?: (event: PointerEvent) => void,
40-
|}>;
40+
}>;
4141

4242
/**
4343
* @see https://reactnative.dev/docs/text#reference
4444
*/
45-
export type TextProps = $ReadOnly<{|
45+
export type TextProps = $ReadOnly<{
4646
...PointerEventProps,
4747

4848
/**
@@ -265,4 +265,4 @@ export type TextProps = $ReadOnly<{|
265265
* See https://reactnative.dev/docs/text.html#linebreakstrategyios
266266
*/
267267
lineBreakStrategyIOS?: ?('none' | 'standard' | 'hangul-word' | 'push-out'),
268-
|}>;
268+
}>;

packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8018,18 +8018,18 @@ declare export const NativeVirtualText: HostComponent<NativeTextProps>;
80188018
`;
80198019

80208020
exports[`public API should not change unintentionally Libraries/Text/TextProps.js 1`] = `
8021-
"export type PressRetentionOffset = $ReadOnly<{|
8021+
"export type PressRetentionOffset = $ReadOnly<{
80228022
top: number,
80238023
left: number,
80248024
bottom: number,
80258025
right: number,
8026-
|}>;
8027-
type PointerEventProps = $ReadOnly<{|
8026+
}>;
8027+
type PointerEventProps = $ReadOnly<{
80288028
onPointerEnter?: (event: PointerEvent) => void,
80298029
onPointerLeave?: (event: PointerEvent) => void,
80308030
onPointerMove?: (event: PointerEvent) => void,
8031-
|}>;
8032-
export type TextProps = $ReadOnly<{|
8031+
}>;
8032+
export type TextProps = $ReadOnly<{
80338033
...PointerEventProps,
80348034
accessible?: ?boolean,
80358035
accessibilityActions?: ?$ReadOnlyArray<AccessibilityActionInfo>,
@@ -8094,7 +8094,7 @@ export type TextProps = $ReadOnly<{|
80948094
minimumFontScale?: ?number,
80958095
suppressHighlighting?: ?boolean,
80968096
lineBreakStrategyIOS?: ?(\\"none\\" | \\"standard\\" | \\"hangul-word\\" | \\"push-out\\"),
8097-
|}>;
8097+
}>;
80988098
"
80998099
`;
81008100

0 commit comments

Comments
 (0)