Skip to content

Commit

Permalink
Fixing misuses of the Text type
Browse files Browse the repository at this point in the history
Reviewed By: fkgozali

Differential Revision: D7227752

fbshipit-source-id: 3577c86b416a7c04190063243839e98e2a80ec7f
  • Loading branch information
elicwhite authored and facebook-github-bot committed Mar 11, 2018
1 parent cd8128b commit 3fd82d3
Showing 1 changed file with 24 additions and 18 deletions.
42 changes: 24 additions & 18 deletions Libraries/Text/TextProps.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

import type {Node} from 'react';

import type {LayoutEvent} from 'CoreEventTypes';
import type {TextStyleProp} from 'StyleSheet';
import type {LayoutEvent, PressEvent} from 'CoreEventTypes';
import type {DangerouslyImpreciseStyleProp} from 'StyleSheet';

type PressRetentionOffset = {
top: number,
Expand All @@ -26,28 +26,34 @@ type PressRetentionOffset = {
/**
* @see https://facebook.github.io/react-native/docs/text.html#reference
*/
export type TextProps = {|
accessible?: boolean,
allowFontScaling?: boolean,
export type TextProps = $ReadOnly<{
accessible?: ?boolean,
allowFontScaling?: ?boolean,
children?: Node,
ellipsizeMode?: 'clip' | 'head' | 'middle' | 'tail',
nativeID?: string,
numberOfLines?: number,
onLayout?: ?(event: LayoutEvent) => void,
onLongPress?: ?() => void,
onPress?: ?() => void,
pressRetentionOffset?: PressRetentionOffset,
selectable?: boolean,
style?: TextStyleProp,
numberOfLines?: ?number,
onLayout?: ?(event: LayoutEvent) => mixed,
onLongPress?: ?(event: PressEvent) => mixed,
onPress?: ?(event: PressEvent) => mixed,
onResponderGrant?: ?Function,
onResponderMove?: ?Function,
onResponderRelease?: ?Function,
onResponderTerminate?: ?Function,
onResponderTerminationRequest?: ?Function,
onStartShouldSetResponder?: ?Function,
pressRetentionOffset?: ?PressRetentionOffset,
selectable?: ?boolean,
style?: ?DangerouslyImpreciseStyleProp,
testID?: string,

// Android Only
disabled?: boolean,
selectionColor?: string,
disabled?: ?boolean,
selectionColor?: ?string,
textBreakStrategy?: 'balanced' | 'highQuality' | 'simple',

// iOS Only
adjustsFontSizeToFit?: boolean,
minimumFontScale?: number,
suppressHighlighting?: boolean,
|};
adjustsFontSizeToFit?: ?boolean,
minimumFontScale?: ?number,
suppressHighlighting?: ?boolean,
}>;

0 comments on commit 3fd82d3

Please sign in to comment.