Skip to content

Commit 45d0d27

Browse files
author
Mohsen Biglari
committed
remove isCustomTabComponent option
1 parent 4fba4eb commit 45d0d27

File tree

4 files changed

+4
-10
lines changed

4 files changed

+4
-10
lines changed

src/com/react-dynamic-tabs/tab/tab.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,9 @@ const Tab = memo(
66
function Tab(props) {
77
React.useContext(ForceUpdateContext);
88
const { id, selectedTabID } = props
9-
, api = React.useContext(ApiContext);
10-
const TabInnerComponent = api.getOption('tabComponent');
11-
if (!TabInnerComponent) {
12-
debugger;
13-
}
14-
const tabObj = api.getTab(id)
9+
, api = React.useContext(ApiContext)
10+
, TabInnerComponent = api.getOption('tabComponent')
11+
, tabObj = api.getTab(id)
1512
, propsManager = new TabPropsManager({ api, id, isSelected: selectedTabID === id })
1613
, clkHandler = function (e) { api.eventHandlerFactory({ e, id }); };
1714
return (

src/com/react-dynamic-tabs/useDynamicTabs/createDefaultOptions.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ CreateDefaultOptions.prototype._getOptions = function () {
2020
onChange: function ({ currentData, perviousData }) { },
2121
onLoad: function (api) { },
2222
onDestroy: function () { },
23-
isCustomTabComponent: false,// shoud be removed
2423
accessibility: true,
2524
defaultPanelComponent: null
2625
};
@@ -43,7 +42,6 @@ CreateDefaultOptions.prototype._getOptions = function () {
4342
set(fn) {
4443
if (fn && (typeof fn !== 'function'))
4544
throw 'tabComponent property must be type of a function.';
46-
_options.isCustomTabComponent = fn ? true : false;
4745
_tabComponent = fn ? fn : that._DefaulTabInnerComponent;
4846
},
4947
enumerable: true

src/com/react-dynamic-tabs/utils/api/optionManager/optionManager.factory.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ function OptionManager(getDeps, { options }) {
44
const { globalDefaultOptions } = getDeps();
55
this._defaultOptions = globalDefaultOptions;
66
this._validateOptions(options);
7-
debugger;
87
this.options = Object.assign({}, this._defaultOptions, options);
98
this._setSetting();
109
};

src/com/react-dynamic-tabs/utils/helper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ helper.getCopyState = function (state) {
99
return newState;
1010
};
1111
helper.assingAll = function (targetObj, ...sourcObjs) {
12-
// copy all enumerable and none-enumerable properties into target
12+
// copy all enumerable and not enumerable properties into the target
1313
sourcObjs.map(sourcObj => {
1414
Object.getOwnPropertyNames(sourcObj).map(prop => {
1515
targetObj[prop] = sourcObj[prop];

0 commit comments

Comments
 (0)