From 7fc51c8ceafa776ba94bca1f815ef700b4032b27 Mon Sep 17 00:00:00 2001 From: Eric Kreutzer Date: Thu, 23 Jun 2016 03:06:36 -0700 Subject: [PATCH] use ColorPropType everywhere there is a color prop on TextInput Summary: If using colors that are not strings react native would warn you of the problem. I made some changes so color props use `ColorPropType` instead of `PropTypes.string`. Closes https://github.com/facebook/react-native/pull/8325 Differential Revision: D3475516 Pulled By: javache fbshipit-source-id: b7e40a0de5e665fc5f41a975650bbba0ec210814 --- Libraries/Components/TextInput/TextInput.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Libraries/Components/TextInput/TextInput.js b/Libraries/Components/TextInput/TextInput.js index 346e93b37..4f9630997 100644 --- a/Libraries/Components/TextInput/TextInput.js +++ b/Libraries/Components/TextInput/TextInput.js @@ -11,6 +11,7 @@ */ 'use strict'; +var ColorPropType = require('ColorPropType'); var DocumentSelectionState = require('DocumentSelectionState'); var EventEmitter = require('EventEmitter'); var NativeMethodsMixin = require('NativeMethodsMixin'); @@ -269,7 +270,7 @@ var TextInput = React.createClass({ /** * The text color of the placeholder string */ - placeholderTextColor: PropTypes.string, + placeholderTextColor: ColorPropType, /** * If true, the text input obscures the text entered so that sensitive text * like passwords stay secure. The default value is false. @@ -278,7 +279,7 @@ var TextInput = React.createClass({ /** * The highlight (and cursor on ios) color of the text input */ - selectionColor: PropTypes.string, + selectionColor: ColorPropType, /** * See DocumentSelectionState.js, some state that is responsible for * maintaining selection information for a document @@ -336,7 +337,7 @@ var TextInput = React.createClass({ * The color of the textInput underline. * @platform android */ - underlineColorAndroid: PropTypes.string, + underlineColorAndroid: ColorPropType, }, /**