@@ -419,11 +419,15 @@ const [TabList, PanelList, ready] = useDynTabs({isVertical: true});
419419``` js
420420const [TabList , PanelList , ready ] = useDynTabs ({
421421 onLoad : function () {
422- // you can use 'this' here which refers to the instance
422+ console . log ( ' [onLoad] ' );
423423 },
424424});
425425```
426426
427+ ** NOTE :**
428+
429+ You can use 'this' keyword inside all callback options which refers to the instance object.
430+
427431### onInit
428432
429433<table >
@@ -446,7 +450,7 @@ const [TabList, PanelList, ready] = useDynTabs({
446450``` js
447451const [TabList , PanelList , ready ] = useDynTabs ({
448452 onInit : function () {
449- // you can use 'this' here which refers to the instance
453+ console . log ( ' [onInit] ' );
450454 },
451455});
452456```
@@ -477,7 +481,7 @@ Do not use setState inside the onInit callback because it leads to an infinite l
477481``` js
478482const [TabList , PanelList , ready ] = useDynTabs ({
479483 onChange : function ({currentData, previousData, closedTabIDs, openedTabIDs}) {
480- // you can use 'this' here which refers to the instance
484+ console . log ( ' [onChange] ' );
481485 },
482486});
483487```
@@ -507,7 +511,7 @@ const [TabList, PanelList, ready] = useDynTabs({
507511``` js
508512const [TabList , PanelList , ready ] = useDynTabs ({
509513 beforeSelect : function (e , id ) {
510- // you can use 'this' here which refers to the instance
514+ console . log ( ' [beforeSelect] ' );
511515 return true ;
512516 },
513517});
@@ -535,7 +539,7 @@ const [TabList, PanelList, ready] = useDynTabs({
535539``` js
536540const [TabList , PanelList , ready ] = useDynTabs ({
537541 onSelect : function ({currentSelectedTabId, previousSelectedTabId}) {
538- // you can use 'this' here which refers to the instance
542+ console . log ( ' [onSelect] ' );
539543 },
540544});
541545```
@@ -562,7 +566,7 @@ const [TabList, PanelList, ready] = useDynTabs({
562566``` js
563567const [TabList , PanelList , ready ] = useDynTabs ({
564568 onOpen : function (openedTabIDs ) {
565- // you can use 'this' here which refers to the instance
569+ console . log ( ' [onOpen] ' );
566570 },
567571});
568572```
@@ -592,7 +596,7 @@ const [TabList, PanelList, ready] = useDynTabs({
592596``` js
593597const [TabList , PanelList , ready ] = useDynTabs ({
594598 beforeClose : function (e , id ) {
595- // you can use 'this' here which refers to the instance
599+ console . log ( ' [beforeClose] ' );
596600 return true ;
597601 },
598602});
@@ -620,7 +624,7 @@ const [TabList, PanelList, ready] = useDynTabs({
620624``` js
621625const [TabList , PanelList , ready ] = useDynTabs ({
622626 onClose : function (closedTabIDs ) {
623- // you can use 'this' here which refers to the instance
627+ console . log ( ' [onClose] ' );
624628 },
625629});
626630```
@@ -647,7 +651,7 @@ const [TabList, PanelList, ready] = useDynTabs({
647651``` js
648652const [TabList , PanelList , ready ] = useDynTabs ({
649653 onDestroy : function () {
650- // you can use 'this' here which refers to the instance
654+ console . log ( ' [onDestroy] ' );
651655 },
652656});
653657```
0 commit comments