Focus input after redux dispatch finished : <p>I am dynamically creating list of inputs with React and Redux. After clicking a button an input is added to the end of list. I need to focus last added input. I tried this code but it focuses penultimate input</p>

<pre><code>const mapDispatchToProps = (dispatch, ownProps) =&gt; ({
    onOptionsChange: (newOptions) =&gt; {
        dispatch(formActions.updateOptions(newOptions));
    }
});

...
this.props.onOptionsChange({ ...this.props, inputsList}); // change list of inputs
ReactDOM.findDOMNode(this.inputs[this.props.choices.length - 1]).focus();
</code></pre>

<p>In logs I can see that focus() is executed before props from state are updated. How can I wait for dispatch to finish?</p>
