I came out with the following (working) solution:
var NameInput = React.createClass({ getInitialState() { return { textValue: '' } }, clearAndRetainFocus: function(evt, elem) { this.setState({textValue: elem.text}); setTimeout(function() { this.setState({textValue: this.getInitialState().textValue}); this.refs.Name.focus(); }.bind(this), 0); }, render() { return( <TextInput ref='Name' value={this.state.textValue} onEndEditing={this.clearAndRetainFocus} /> ) } });
So, basically, when we finish editing, we set the textValue state to TextInput and right after that (in setTimeout ), we return it back to the default (empty) and keep focus on the element.
source share