JSFiddle - React, Tailwind, and code Playground
HTML
<div id="news">Original text here - click to animate</div>
CSS
#news {
background-color: lightblue;
width: 250px
}
JavaScript
$("#news").click(function(){
var strData = "The new text here";
$("#news").hide("slide", { direction: "down" }, 500,
function() { $(this).html(strData); })
.show("slide", { direction: "up"}, 500);
});