This repository was archived by the owner on Jun 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 151
Expand file tree
/
Copy pathText.js
More file actions
55 lines (50 loc) · 1.53 KB
/
Text.js
File metadata and controls
55 lines (50 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/**
* https://github.com/facebook/react-native/blob/master/Libraries/Text/Text.js
*/
import PropTypes from 'prop-types';
import styleSheetPropType from '../propTypes/StyleSheetPropType';
import TextStylePropTypes from '../propTypes/TextStylePropTypes';
import NativeMethodsMixin from '../mixins/NativeMethodsMixin';
import createReactClass from 'create-react-class';
const stylePropType = styleSheetPropType(TextStylePropTypes);
const Text = createReactClass({
propTypes: {
/**
* Used to truncate the text with an ellipsis after computing the text
* layout, including line wrapping, such that the total number of lines
* does not exceed this number.
*/
numberOfLines: PropTypes.number,
/**
* Invoked on mount and layout changes with
*
* `{nativeEvent: {layout: {x, y, width, height}}}`
*/
onLayout: PropTypes.func,
/**
* This function is called on press.
*/
onPress: PropTypes.func,
/**
* When true, no visual change is made when text is pressed down. By
* default, a gray oval highlights the text on press down.
* @platform ios
*/
suppressHighlighting: PropTypes.bool,
style: stylePropType,
/**
* Used to locate this view in end-to-end tests.
*/
testID: PropTypes.string,
/**
* Specifies should fonts scale to respect Text Size accessibility setting on iOS.
* @platform ios
*/
allowFontScaling: PropTypes.bool,
},
mixins: [NativeMethodsMixin],
render() {
return null;
},
});
module.exports = Text;