JSFiddle - React, Tailwind, and code Playground

by Walter Rumsby

JavaScript

Ext.define('Ivan', {
    extend: 'Ext.button.Button',
    alias: 'widget.ivan',

    initComponent: function () {
        this.on('click', function (e) {
            console.assert(this.$className === 'Ivan');
            alert('YOLO!');
        }, undefined, {
            single: true
        });

        this.callParent();
    }
});

Ext.widget({
    renderTo: Ext.getBody(),
    xtype: 'ivan',
    text: 'Click Me',
    handler: function () {
        console.log('click');
    }
});