Events
| Property | Type | Description |
|---|---|---|
onChange | function | (optional) (preferred) this event gets triggered once the tab changes its selected key. Returns { key, selectedKey, focusKey, event }. |
onClick | function | (optional) This event gets triggered once the tab gets clicked. Returns { key, selectedKey, focusKey, event }. |
onFocus | function | (optional) This event gets triggered once the tab changes its focus key. Returns { key, selectedKey, focusKey, event }. |
onMouseEnter | function | (optional) This event gets triggered once the user';s mouse enters a tab (hover). Returns { key, selectedKey, focusKey, event }. |
Prevent a change
You can prevent a change from happening by returning false on the onClick event handler:
<TabsonClick={() => {if (condition === true) {return false}}}onChange={() => {// Will not get emitted}}/>