title: setTimeout function not working on latest Ios Safari
body: <p>I have this piece of code that gets called every time my slideshow is switching images. It is supposed to make the opacity of the current image 0, then switch to another image after 250ms.</p>
  <p>The current code works <strong>perfectly</strong> in every browser I've tested except for the <strong>latest ios safari version</strong> (not sure about desktop safari). The problem that I get in safari is that the 250ms delay only works for the first image switch then stops working for any later image switches. The result is that the images switch without the 250ms delay in between.</p>
  <p>Am I doing something I shouldn't be or is this just the behaviour of safari. If so, how should I fix it?</p>
  <pre><code>this.setState(prevState =&gt; ({imageOpacity: 0}), () =&gt; {
  
      setTimeout(()=&gt; {this.setState(prevState =&gt; ({imageIndex: newImageIndex, imageOpacity: 1}))}, 250);
      });
  </code></pre>