title: Update component UI while method is still running - React
body: <p>So I have an onClick method that loops about 1,000 times before returning, and at the end of each loop, it changes the state. Is there a way to get the component to re-render at the end of each loop as well? I though just updating the state would do it, but that didn't work. I also tried calling <code>this.forceUpdate()</code> after updating the state every loop, but that didn't work either. It just does all of the updating all at once after <code>onClick</code> returns.</p>
  <p>Is there a way to have the component update while the event handler is running?
  I am thinking the solution lies in multithreading, but I don't know if there is a better way.</p>