mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-26 13:25:51 +08:00
Updates from Fri Feb 27
- [react-packager] transformModulePath option is not actually required | Amjad Masad - Implement TextInput.clearButtonMode added by D1875684 on OSS fork + example | Tadeu Zagallo - [ReactNative] Use local CocoaPod config for ReactNative modules | Spencer Ahrens - [ReactNative] Pull out some OSS modules into separate libs | Spencer Ahrens - Enqueue events at 60fps + profiling helpers | Tadeu Zagallo
This commit is contained in:
46
Libraries/Text/TextStylePropTypes.js
Normal file
46
Libraries/Text/TextStylePropTypes.js
Normal file
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
* Copyright 2004-present Facebook. All Rights Reserved.
|
||||
*
|
||||
* @providesModule TextStylePropTypes
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
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']
|
||||
),
|
||||
}
|
||||
);
|
||||
|
||||
// Text doesn't support padding correctly (#4841912)
|
||||
var unsupportedProps = Object.keys({
|
||||
padding: null,
|
||||
paddingTop: null,
|
||||
paddingLeft: null,
|
||||
paddingRight: null,
|
||||
paddingBottom: null,
|
||||
paddingVertical: null,
|
||||
paddingHorizontal: null,
|
||||
});
|
||||
|
||||
for (var key in unsupportedProps) {
|
||||
delete TextStylePropTypes[key];
|
||||
}
|
||||
|
||||
module.exports = TextStylePropTypes;
|
||||
Reference in New Issue
Block a user