From c53404a6889b8f8718d90cda161523c06ebcb43f Mon Sep 17 00:00:00 2001 From: Bin Yue Date: Wed, 15 Mar 2017 17:46:14 -0700 Subject: [PATCH] Fix TextInput 'defaultValue' propTypes to 'string' Summary: Because `TextInput` only render the `defaultValue` of `string`, when using other types of values, it will render empty('') without any Warnings. Closes https://github.com/facebook/react-native/pull/11478 Differential Revision: D4340132 Pulled By: lacker fbshipit-source-id: aedb96d49277836000c0adc53007c97db6363253 --- Libraries/Components/TextInput/TextInput.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/Components/TextInput/TextInput.js b/Libraries/Components/TextInput/TextInput.js index e9b2de7d547..d1c3e6fd27f 100644 --- a/Libraries/Components/TextInput/TextInput.js +++ b/Libraries/Components/TextInput/TextInput.js @@ -452,7 +452,7 @@ const TextInput = React.createClass({ * Useful for simple use-cases where you do not want to deal with listening * to events and updating the value prop to keep the controlled state in sync. */ - defaultValue: PropTypes.node, + defaultValue: PropTypes.string, /** * When the clear button should appear on the right side of the text view. * @platform ios