JSFiddle - React, Tailwind, and code Playground
HTML
<head></head>
<body>
<button id="btnOld" type="button">Old API</button>
<button id="btnNew" type="button">New Feature</button>
</body>
JavaScript
$.widget('sample.dialog', $.ui.dialog, {
_create: function() {
this.options.title = 'Overrided title';
this._super("_create");
}
};
$('#dlgOld').click(function(e) { alert('old');
$('<div></div>').appnedTo($('body')).dialog({ title: 'Some title' });
e.preventDefault(); return false;
});
$('#dlgNew').click(function(e) { alert('new');
$.ui.dialog({ title: 'Some title' });
e.preventDefault(); return false;
});