From 000ab1139f0dfdcf034d9864d459fe5b91e03030 Mon Sep 17 00:00:00 2001 From: Matej Hamas Date: Fri, 24 Jul 2015 09:34:18 -0700 Subject: [PATCH] [ReactNative] Adding clear function to the react native TextInput component. --- Libraries/Components/TextInput/TextInput.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Libraries/Components/TextInput/TextInput.js b/Libraries/Components/TextInput/TextInput.js index 01d6dbbfb..9d4de3a77 100644 --- a/Libraries/Components/TextInput/TextInput.js +++ b/Libraries/Components/TextInput/TextInput.js @@ -346,6 +346,10 @@ var TextInput = React.createClass({ isInAParentText: React.PropTypes.bool }, + clear: function() { + this.setNativeProps({text: ''}); + }, + render: function() { if (Platform.OS === 'ios') { return this._renderIOS();