JSFiddle - React, Tailwind, and code Playground
HTML
<div id="hide">Hide Me</div>
<div id="show" style="display:none">Then show Me</div>
JavaScript
(function(){
$.when(hide())
.then(function(){
$("#show").fadeIn(3000);
});
function hide(){
return $.Deferred(function(dfd){
$("#hide").fadeOut(3000,function(){
dfd.resolve();
});
}).promise();
};
}());