[react-native] Use SpreadProperty to make react-docgen happy
This commit is contained in:
parent
ca3be21484
commit
81d024924c
|
@ -8,13 +8,11 @@
|
|||
var LayoutPropTypes = require('LayoutPropTypes');
|
||||
var ReactPropTypes = require('ReactPropTypes');
|
||||
|
||||
var merge = require('merge');
|
||||
|
||||
/**
|
||||
* Warning: Some of these properties may not be supported in all releases.
|
||||
*/
|
||||
var ViewStylePropTypes = merge(
|
||||
LayoutPropTypes, {
|
||||
var ViewStylePropTypes = {
|
||||
...LayoutPropTypes,
|
||||
backgroundColor: ReactPropTypes.string,
|
||||
borderColor: ReactPropTypes.string,
|
||||
borderTopColor: ReactPropTypes.string,
|
||||
|
@ -36,6 +34,6 @@ var ViewStylePropTypes = merge(
|
|||
scaleY: ReactPropTypes.number,
|
||||
translateX: ReactPropTypes.number,
|
||||
translateY: ReactPropTypes.number,
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = ViewStylePropTypes;
|
||||
|
|
|
@ -9,23 +9,19 @@ var ImageResizeMode = require('ImageResizeMode');
|
|||
var LayoutPropTypes = require('LayoutPropTypes');
|
||||
var ReactPropTypes = require('ReactPropTypes');
|
||||
|
||||
var merge = require('merge');
|
||||
var ImageStylePropTypes = {
|
||||
...LayoutPropTypes,
|
||||
resizeMode: ReactPropTypes.oneOf(Object.keys(ImageResizeMode)),
|
||||
backgroundColor: ReactPropTypes.string,
|
||||
borderColor: ReactPropTypes.string,
|
||||
borderWidth: ReactPropTypes.number,
|
||||
borderRadius: ReactPropTypes.number,
|
||||
|
||||
var ImageStylePropTypes = merge(
|
||||
LayoutPropTypes,
|
||||
{
|
||||
resizeMode: ReactPropTypes.oneOf(Object.keys(ImageResizeMode)),
|
||||
backgroundColor: ReactPropTypes.string,
|
||||
borderColor: ReactPropTypes.string,
|
||||
borderWidth: ReactPropTypes.number,
|
||||
borderRadius: ReactPropTypes.number,
|
||||
|
||||
// iOS-Specific style to "tint" an image.
|
||||
// It changes the color of all the non-transparent pixels to the tintColor
|
||||
tintColor: ReactPropTypes.string,
|
||||
opacity: ReactPropTypes.number,
|
||||
}
|
||||
);
|
||||
// iOS-Specific style to "tint" an image.
|
||||
// It changes the color of all the non-transparent pixels to the tintColor
|
||||
tintColor: ReactPropTypes.string,
|
||||
opacity: ReactPropTypes.number,
|
||||
};
|
||||
|
||||
// Image doesn't support padding correctly (#4841912)
|
||||
var unsupportedProps = Object.keys({
|
||||
|
|
|
@ -8,25 +8,22 @@
|
|||
var ReactPropTypes = require('ReactPropTypes');
|
||||
var ViewStylePropTypes = require('ViewStylePropTypes');
|
||||
|
||||
var merge = require('merge');
|
||||
|
||||
var TextStylePropTypes = merge(
|
||||
ViewStylePropTypes, {
|
||||
fontFamily: ReactPropTypes.string,
|
||||
fontSize: ReactPropTypes.number,
|
||||
fontWeight: ReactPropTypes.oneOf(['normal' /*default*/, 'bold']),
|
||||
fontStyle: ReactPropTypes.oneOf(['normal', 'italic']),
|
||||
lineHeight: ReactPropTypes.number,
|
||||
color: ReactPropTypes.string,
|
||||
containerBackgroundColor: ReactPropTypes.string,
|
||||
textAlign: ReactPropTypes.oneOf(
|
||||
['auto' /*default*/, 'left', 'right', 'center']
|
||||
),
|
||||
writingDirection: ReactPropTypes.oneOf(
|
||||
['auto' /*default*/, 'ltr', 'rtl']
|
||||
),
|
||||
}
|
||||
);
|
||||
var TextStylePropTypes = {
|
||||
...ViewStylePropTypes,
|
||||
fontFamily: ReactPropTypes.string,
|
||||
fontSize: ReactPropTypes.number,
|
||||
fontWeight: ReactPropTypes.oneOf(['normal' /*default*/, 'bold']),
|
||||
fontStyle: ReactPropTypes.oneOf(['normal', 'italic']),
|
||||
lineHeight: ReactPropTypes.number,
|
||||
color: ReactPropTypes.string,
|
||||
containerBackgroundColor: ReactPropTypes.string,
|
||||
textAlign: ReactPropTypes.oneOf(
|
||||
['auto' /*default*/, 'left', 'right', 'center']
|
||||
),
|
||||
writingDirection: ReactPropTypes.oneOf(
|
||||
['auto' /*default*/, 'ltr', 'rtl']
|
||||
),
|
||||
};
|
||||
|
||||
// Text doesn't support padding correctly (#4841912)
|
||||
var unsupportedProps = Object.keys({
|
||||
|
|
Loading…
Reference in New Issue