[ReactNative] Adding clear function to the react native TextInput component.

This commit is contained in:
Matej Hamas 2015-07-24 09:34:18 -07:00
parent 81dd9c27ea
commit 000ab1139f
1 changed files with 4 additions and 0 deletions

View File

@ -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();