JSFiddle - React, Tailwind, and code Playground

HTML

<div id="dialog" title="Basic dialog">
  <p> Use the beforeClose option to prevent this dialog to be closed.</p>
</div>

JavaScript

$( "#dialog" ).dialog({
   beforeClose: function(){
     return false;
   }
});