react-native/Libraries/StyleSheet
Christopher Chedeau 1491668b35 ColorPropTypes support for isRequired and more precise description
Summary:
The previous implementation of ColorPropType was very hacky as it used `ReactPropTypes.oneOfType([colorValidator, ReactPropTypes.number])`. It turns out that oneOfType also accepts arbitrary functions instead of a type, but doesn't display any of the error message.

In this diff I properly implement isRequired (sadly we don't export `createChainableTypeChecker` in ReactPropTypes) and provide a lot more context that we have. I copy and pasted the way we displayed this context from the existing checkers.

**Test Plan**

When doing .isRequired and do not provide the value:

![simulator screen shot feb 1 2016 9 56 00 am](https://cloud.githubusercontent.com/assets/197597/12726239/61243f88-c8cb-11e5-889b-6594ffd85973.png)

When providing a bad value:

![simulator screen shot feb 1 2016 10 01 25 am](https://cloud.githubusercontent.com/assets/197597/12726244/6e80aa36-c8cb-11e5-9bd3-a8637de75496.png)
Closes https://github.com/facebook/react-native/pull/5671

Reviewed By: svcscm

Differential Revision: D2886760

Pulled By: vjeux

fb-gh-sync-id: d6be42b5768fca5463fe80fe4b144506d21b0832
2016-02-01 12:47:32 -08:00
..
__tests__ Temporarily allow decimals on rgb() and rgba() 2016-01-31 22:46:38 -08:00
ColorPropType.js ColorPropTypes support for isRequired and more precise description 2016-02-01 12:47:32 -08:00
EdgeInsetsPropType.js [ReactNative] clean lint in all of Libraries/ 2015-05-19 13:47:04 -08:00
LayoutPropTypes.js Remove min/max Width/Height in the docs 2016-01-27 18:26:56 -08:00
PointPropType.js [ReactNative] clean lint in all of Libraries/ 2015-05-19 13:47:04 -08:00
StyleSheet.js PixelRatio.pixel() 2016-01-15 05:15:31 -08:00
StyleSheetPropType.js Flowify Libraries/StyleSheet and Libraries/Text 2015-03-24 16:22:59 -08:00
StyleSheetRegistry.js Flowify Libraries/StyleSheet and Libraries/Text 2015-03-24 16:22:59 -08:00
StyleSheetTypes.js [Flow] Clean up react-native for Flow v0.15.0 2015-09-04 16:51:18 -08:00
StyleSheetValidation.js [ReactNative] Add overflow to the whitelisted Image props 2015-07-27 11:06:27 -08:00
TransformPropTypes.js Add a deprecatedPropType module to show deprecation warnings 2016-01-29 02:05:38 -08:00
flattenStyle.js [Flow] Clean up react-native for Flow v0.15.0 2015-09-04 16:51:18 -08:00
normalizeColor.js Temporarily allow decimals on rgb() and rgba() 2016-01-31 22:46:38 -08:00
processColor.js Reimplement color processing 2016-01-29 09:13:32 -08:00
processTransform.js Ensure perspective value is non-zero 2016-01-25 06:01:53 -08:00
styleDiffer.js Flowify Libraries/StyleSheet and Libraries/Text 2015-03-24 16:22:59 -08:00