mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-01 09:08:47 +08:00
[ReactNative] Adding clear function to the react native TextInput component.
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user