JSFiddle - React, Tailwind, and code Playground

HTML

<!-- Here we have an element that has an overlay that appears on mouseover. -->
<div class="with-overlay">
    <div class="overlay">
        <div>
            <p>It's an overlay!</p>
        </div>
    </div>
</div>

CSS

.with-overlay {
  position: relative;
    /* These are here just to make an anchor for the overlay */
    height: 300px;
    width: 300px;
    background: #000;
}

.with-overlay:hover .overlay {
  background: rgba(255, 230, 230, 0.8);
}

.with-overlay:hover .overlay div {
    /* This line breaks the animation. 
    * Remove it, and the animation works every time. */
    display: block; 
}

/* ...and matching div overlay */
.overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-origin: content-box;
  z-index: 150;
}

.overlay div {
  display: none;
  padding: 25px;
}

JavaScript

/* I've tried with slideDown/Up and fadeIn/Out, 
* but I suspect that any animation here would 
* suffer the same issue. */
$('.with-overlay').hover(
   function() {
      $('.overlay div', this).stop(true, true).slideDown();
   },
   function() {
      $('.overlay div', this).stop(true, true).slideUp();
   }
);