React: how to force state changes to take place after setState
<p>How to force the state update to take place in React after calling setState?</p>

<p>As far as I know, state is effectively updated when render is called next time. Also, <code>forceUpdate()</code> should re-render the component and update the state changes immediately, right? However this doesn't seem to be the case. Here's an example.</p>

<pre><code>handleSomeEvent(data) {
    this.setState({
        data: data
    })
    this.forceUpdate()

    // At this point state should be updated but it isn't
    this.props.consumeData(this.state.data) // consumeData will receive old data
}
</code></pre>

<p>How do I ensure state is actually updated before calling consumeData?</p>