I have a component with input, is there any way to focus using the name?
<div onClick={this.handleClick.bind(this)}>
... Some more code ...
<input type="text" name={this.props.name} onChange={this.props.onChange} autoFocus/>
... Some more code ...
</div>
On click of the parent div, I have a on click event attached to it.
handleClick(e) {
// Need to focus may be using refs, but not sure how to do it.
return this.props.onClick(this.props.name);
}