@@ -30,184 +30,256 @@ var LayoutPropTypes = {
30
30
/** `width` sets the width of this component.
31
31
*
32
32
* It works similarly to `width` in CSS, but in React Native you
33
- * must use logical pixel units, rather than percents, ems, or any of that .
33
+ * must use points or percentages. Ems and other units are not supported .
34
34
* See https://developer.mozilla.org/en-US/docs/Web/CSS/width for more details.
35
35
*/
36
- width : ReactPropTypes . number ,
36
+ width : ReactPropTypes . oneOfType ( [
37
+ ReactPropTypes . number ,
38
+ ReactPropTypes . string ,
39
+ ] ) ,
37
40
38
41
/** `height` sets the height of this component.
39
42
*
40
43
* It works similarly to `height` in CSS, but in React Native you
41
- * must use logical pixel units, rather than percents, ems, or any of that .
44
+ * must use points or percentages. Ems and other units are not supported .
42
45
* See https://developer.mozilla.org/en-US/docs/Web/CSS/height for more details.
43
46
*/
44
- height : ReactPropTypes . number ,
47
+ height : ReactPropTypes . oneOfType ( [
48
+ ReactPropTypes . number ,
49
+ ReactPropTypes . string ,
50
+ ] ) ,
45
51
46
52
/** `top` is the number of logical pixels to offset the top edge of
47
53
* this component.
48
54
*
49
- * It works similarly to `top` in CSS, but in React Native you must
50
- * use logical pixel units, rather than percents, ems, or any of that .
55
+ * It works similarly to `top` in CSS, but in React Native you
56
+ * must use points or percentages. Ems and other units are not supported .
51
57
*
52
58
* See https://developer.mozilla.org/en-US/docs/Web/CSS/top
53
59
* for more details of how `top` affects layout.
54
60
*/
55
- top : ReactPropTypes . number ,
61
+ top : ReactPropTypes . oneOfType ( [
62
+ ReactPropTypes . number ,
63
+ ReactPropTypes . string ,
64
+ ] ) ,
56
65
57
66
/** `left` is the number of logical pixels to offset the left edge of
58
67
* this component.
59
68
*
60
- * It works similarly to `left` in CSS, but in React Native you must
61
- * use logical pixel units, rather than percents, ems, or any of that .
69
+ * It works similarly to `left` in CSS, but in React Native you
70
+ * must use points or percentages. Ems and other units are not supported .
62
71
*
63
72
* See https://developer.mozilla.org/en-US/docs/Web/CSS/left
64
73
* for more details of how `left` affects layout.
65
74
*/
66
- left : ReactPropTypes . number ,
75
+ left : ReactPropTypes . oneOfType ( [
76
+ ReactPropTypes . number ,
77
+ ReactPropTypes . string ,
78
+ ] ) ,
67
79
68
80
/** `right` is the number of logical pixels to offset the right edge of
69
81
* this component.
70
82
*
71
- * It works similarly to `right` in CSS, but in React Native you must
72
- * use logical pixel units, rather than percents, ems, or any of that .
83
+ * It works similarly to `right` in CSS, but in React Native you
84
+ * must use points or percentages. Ems and other units are not supported .
73
85
*
74
86
* See https://developer.mozilla.org/en-US/docs/Web/CSS/right
75
87
* for more details of how `right` affects layout.
76
88
*/
77
- right : ReactPropTypes . number ,
89
+ right : ReactPropTypes . oneOfType ( [
90
+ ReactPropTypes . number ,
91
+ ReactPropTypes . string ,
92
+ ] ) ,
78
93
79
94
/** `bottom` is the number of logical pixels to offset the bottom edge of
80
95
* this component.
81
96
*
82
- * It works similarly to `bottom` in CSS, but in React Native you must
83
- * use logical pixel units, rather than percents, ems, or any of that .
97
+ * It works similarly to `bottom` in CSS, but in React Native you
98
+ * must use points or percentages. Ems and other units are not supported .
84
99
*
85
100
* See https://developer.mozilla.org/en-US/docs/Web/CSS/bottom
86
101
* for more details of how `bottom` affects layout.
87
102
*/
88
- bottom : ReactPropTypes . number ,
103
+ bottom : ReactPropTypes . oneOfType ( [
104
+ ReactPropTypes . number ,
105
+ ReactPropTypes . string ,
106
+ ] ) ,
89
107
90
108
/** `minWidth` is the minimum width for this component, in logical pixels.
91
109
*
92
110
* It works similarly to `min-width` in CSS, but in React Native you
93
- * must use logical pixel units, rather than percents, ems, or any of that .
111
+ * must use points or percentages. Ems and other units are not supported .
94
112
*
95
113
* See https://developer.mozilla.org/en-US/docs/Web/CSS/min-width
96
114
* for more details.
97
115
*/
98
- minWidth : ReactPropTypes . number ,
116
+ minWidth : ReactPropTypes . oneOfType ( [
117
+ ReactPropTypes . number ,
118
+ ReactPropTypes . string ,
119
+ ] ) ,
99
120
100
121
/** `maxWidth` is the maximum width for this component, in logical pixels.
101
122
*
102
123
* It works similarly to `max-width` in CSS, but in React Native you
103
- * must use logical pixel units, rather than percents, ems, or any of that .
124
+ * must use points or percentages. Ems and other units are not supported .
104
125
*
105
126
* See https://developer.mozilla.org/en-US/docs/Web/CSS/max-width
106
127
* for more details.
107
128
*/
108
- maxWidth : ReactPropTypes . number ,
129
+ maxWidth : ReactPropTypes . oneOfType ( [
130
+ ReactPropTypes . number ,
131
+ ReactPropTypes . string ,
132
+ ] ) ,
109
133
110
134
/** `minHeight` is the minimum height for this component, in logical pixels.
111
135
*
112
136
* It works similarly to `min-height` in CSS, but in React Native you
113
- * must use logical pixel units, rather than percents, ems, or any of that .
137
+ * must use points or percentages. Ems and other units are not supported .
114
138
*
115
139
* See https://developer.mozilla.org/en-US/docs/Web/CSS/min-height
116
140
* for more details.
117
141
*/
118
- minHeight : ReactPropTypes . number ,
142
+ minHeight : ReactPropTypes . oneOfType ( [
143
+ ReactPropTypes . number ,
144
+ ReactPropTypes . string ,
145
+ ] ) ,
119
146
120
147
/** `maxHeight` is the maximum height for this component, in logical pixels.
121
148
*
122
149
* It works similarly to `max-height` in CSS, but in React Native you
123
- * must use logical pixel units, rather than percents, ems, or any of that .
150
+ * must use points or percentages. Ems and other units are not supported .
124
151
*
125
152
* See https://developer.mozilla.org/en-US/docs/Web/CSS/max-height
126
153
* for more details.
127
154
*/
128
- maxHeight : ReactPropTypes . number ,
155
+ maxHeight : ReactPropTypes . oneOfType ( [
156
+ ReactPropTypes . number ,
157
+ ReactPropTypes . string ,
158
+ ] ) ,
129
159
130
160
/** Setting `margin` has the same effect as setting each of
131
161
* `marginTop`, `marginLeft`, `marginBottom`, and `marginRight`.
132
162
* See https://developer.mozilla.org/en-US/docs/Web/CSS/margin
133
163
* for more details.
134
164
*/
135
- margin : ReactPropTypes . number ,
165
+ margin : ReactPropTypes . oneOfType ( [
166
+ ReactPropTypes . number ,
167
+ ReactPropTypes . string ,
168
+ ] ) ,
136
169
137
170
/** Setting `marginVertical` has the same effect as setting both
138
171
* `marginTop` and `marginBottom`.
139
172
*/
140
- marginVertical : ReactPropTypes . number ,
173
+ marginVertical : ReactPropTypes . oneOfType ( [
174
+ ReactPropTypes . number ,
175
+ ReactPropTypes . string ,
176
+ ] ) ,
141
177
142
178
/** Setting `marginHorizontal` has the same effect as setting
143
179
* both `marginLeft` and `marginRight`.
144
180
*/
145
- marginHorizontal : ReactPropTypes . number ,
181
+ marginHorizontal : ReactPropTypes . oneOfType ( [
182
+ ReactPropTypes . number ,
183
+ ReactPropTypes . string ,
184
+ ] ) ,
146
185
147
186
/** `marginTop` works like `margin-top` in CSS.
148
187
* See https://developer.mozilla.org/en-US/docs/Web/CSS/margin-top
149
188
* for more details.
150
189
*/
151
- marginTop : ReactPropTypes . number ,
190
+ marginTop : ReactPropTypes . oneOfType ( [
191
+ ReactPropTypes . number ,
192
+ ReactPropTypes . string ,
193
+ ] ) ,
152
194
153
195
/** `marginBottom` works like `margin-bottom` in CSS.
154
196
* See https://developer.mozilla.org/en-US/docs/Web/CSS/margin-bottom
155
197
* for more details.
156
198
*/
157
- marginBottom : ReactPropTypes . number ,
199
+ marginBottom : ReactPropTypes . oneOfType ( [
200
+ ReactPropTypes . number ,
201
+ ReactPropTypes . string ,
202
+ ] ) ,
158
203
159
204
/** `marginLeft` works like `margin-left` in CSS.
160
205
* See https://developer.mozilla.org/en-US/docs/Web/CSS/margin-left
161
206
* for more details.
162
207
*/
163
- marginLeft : ReactPropTypes . number ,
208
+ marginLeft : ReactPropTypes . oneOfType ( [
209
+ ReactPropTypes . number ,
210
+ ReactPropTypes . string ,
211
+ ] ) ,
164
212
165
213
/** `marginRight` works like `margin-right` in CSS.
166
214
* See https://developer.mozilla.org/en-US/docs/Web/CSS/margin-right
167
215
* for more details.
168
216
*/
169
- marginRight : ReactPropTypes . number ,
217
+ marginRight : ReactPropTypes . oneOfType ( [
218
+ ReactPropTypes . number ,
219
+ ReactPropTypes . string ,
220
+ ] ) ,
170
221
171
222
/** Setting `padding` has the same effect as setting each of
172
223
* `paddingTop`, `paddingBottom`, `paddingLeft`, and `paddingRight`.
173
224
* See https://developer.mozilla.org/en-US/docs/Web/CSS/padding
174
225
* for more details.
175
226
*/
176
- padding : ReactPropTypes . number ,
227
+ padding : ReactPropTypes . oneOfType ( [
228
+ ReactPropTypes . number ,
229
+ ReactPropTypes . string ,
230
+ ] ) ,
177
231
178
232
/** Setting `paddingVertical` is like setting both of
179
233
* `paddingTop` and `paddingBottom`.
180
234
*/
181
- paddingVertical : ReactPropTypes . number ,
235
+ paddingVertical : ReactPropTypes . oneOfType ( [
236
+ ReactPropTypes . number ,
237
+ ReactPropTypes . string ,
238
+ ] ) ,
182
239
183
240
/** Setting `paddingHorizontal` is like setting both of
184
241
* `paddingLeft` and `paddingRight`.
185
242
*/
186
- paddingHorizontal : ReactPropTypes . number ,
243
+ paddingHorizontal : ReactPropTypes . oneOfType ( [
244
+ ReactPropTypes . number ,
245
+ ReactPropTypes . string ,
246
+ ] ) ,
187
247
188
248
/** `paddingTop` works like `padding-top` in CSS.
189
249
* See https://developer.mozilla.org/en-US/docs/Web/CSS/padding-top
190
250
* for more details.
191
251
*/
192
- paddingTop : ReactPropTypes . number ,
252
+ paddingTop : ReactPropTypes . oneOfType ( [
253
+ ReactPropTypes . number ,
254
+ ReactPropTypes . string ,
255
+ ] ) ,
193
256
194
257
/** `paddingBottom` works like `padding-bottom` in CSS.
195
258
* See https://developer.mozilla.org/en-US/docs/Web/CSS/padding-bottom
196
259
* for more details.
197
260
*/
198
- paddingBottom : ReactPropTypes . number ,
261
+ paddingBottom : ReactPropTypes . oneOfType ( [
262
+ ReactPropTypes . number ,
263
+ ReactPropTypes . string ,
264
+ ] ) ,
199
265
200
266
/** `paddingLeft` works like `padding-left` in CSS.
201
267
* See https://developer.mozilla.org/en-US/docs/Web/CSS/padding-left
202
268
* for more details.
203
269
*/
204
- paddingLeft : ReactPropTypes . number ,
270
+ paddingLeft : ReactPropTypes . oneOfType ( [
271
+ ReactPropTypes . number ,
272
+ ReactPropTypes . string ,
273
+ ] ) ,
205
274
206
275
/** `paddingRight` works like `padding-right` in CSS.
207
276
* See https://developer.mozilla.org/en-US/docs/Web/CSS/padding-right
208
277
* for more details.
209
278
*/
210
- paddingRight : ReactPropTypes . number ,
279
+ paddingRight : ReactPropTypes . oneOfType ( [
280
+ ReactPropTypes . number ,
281
+ ReactPropTypes . string ,
282
+ ] ) ,
211
283
212
284
/** `borderWidth` works like `border-width` in CSS.
213
285
* See https://developer.mozilla.org/en-US/docs/Web/CSS/border-width
@@ -365,7 +437,10 @@ var LayoutPropTypes = {
365
437
flex : ReactPropTypes . number ,
366
438
flexGrow : ReactPropTypes . number ,
367
439
flexShrink : ReactPropTypes . number ,
368
- flexBasis : ReactPropTypes . number ,
440
+ flexBasis : ReactPropTypes . oneOfType ( [
441
+ ReactPropTypes . number ,
442
+ ReactPropTypes . string ,
443
+ ] ) ,
369
444
370
445
/**
371
446
* Aspect ratio control the size of the undefined dimension of a node. Aspect ratio is a
0 commit comments