JSFiddle - React, Tailwind, and code Playground

HTML

<div id="test"></div>
<div id="test2"></div>

CSS

div {
    background-color: blue;
    width:100px;
    height: 100px
}
#test2 {
    background-color: green;
}

JavaScript

var p = $.when(
    $('#test').fadeOut(500, function() {
            //When removed, the promise is destroyed
            $(this).remove();
            //It works
            //$(this).show();
    })
);

console.log( p );

p.done(function() {
    console.log('done');
    $('#test2').text('TEST OK!!!!');
});