Skip to content

Commit dae41c2

Browse files
remove deprecated version of ready function
1 parent 5f2e364 commit dae41c2

File tree

8 files changed

+494
-157
lines changed

8 files changed

+494
-157
lines changed

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,8 +1309,6 @@ Include `react-dyn-tabs/style/react-dyn-tabs-rtl.min.css` for `rtl` mode
13091309

13101310
These deprecated features can still be used, but should be used with caution because they are expected to be removed entirely sometime in the future. You should work to remove their use from your code.
13111311

1312-
- Third element of returned array by useDynTabs hook should not be used as an object, it is no longer recommended and only be kept for backwards compatibility purposes, it should be used as a function.
1313-
13141312
- First parameter of onSelect function is an object and has perviousSelectedTabId property which is deprecated. you should use previousSelectedTabId property instead of perviousSelectedTabId property.
13151313

13161314
- First parameter of onChange function is an object and has perviousData property which is deprecated. you should use previousData property instead of perviousData property.

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,6 @@
131131
"@popperjs/core": "^2.11.8",
132132
"element-resize-detector": "^1.2.4",
133133
"prop-types": "^15.7.2",
134-
"tabs-more-button": "^0.1.1"
134+
"tabs-more-button": "^1.0.1"
135135
}
136136
}

src/index.test.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,10 @@ describe('apply multiple actions : ', () => {
9494
let _api;
9595
act(() => {
9696
const App = function () {
97-
const [Tablist, Panellist, api] = useDynTabs(op);
98-
_api = api;
97+
const [Tablist, Panellist, ready] = useDynTabs(op);
98+
ready((api) => {
99+
_api = api;
100+
});
99101
return (
100102
<div>
101103
<Tablist></Tablist>

src/plugins/moreButtonPlugin/show-more-tabs/api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ Object.assign(Api.prototype, {
1313
this.tablistEl = this.btnRef.current.previousSibling;
1414
this.tablistContainerEl = this.tablistEl.parentElement.parentElement;
1515
this.tablistViewEl = this.tablistContainerEl.parentElement;
16-
debugger;
1716
this._resizer = this.getResizerIns({
1817
containerElement: this.tablistContainerEl,
1918
buttonElement: this.btnRef.current,
19+
tablistElement: this.tablistEl,
2020
});
2121
},
2222
installResizer: function (resizeDetectorIns) {

src/utils/api/api.factory.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ const _apiProps = {
4848
}
4949
};
5050
ready = ready.bind(this);
51-
// make ready function object for supporting deprecated api
52-
Object.assign(ready, this.userProxy);
5351
this.helper.setNoneEnumProps(this, {ready});
5452
return this;
5553
},

src/utils/api/api.factory.test.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,6 @@ describe('Api.prototype.ready : ', () => {
209209
test('ready function must be a binded function', () => {
210210
expect(Object.prototype.hasOwnProperty.call(obj.ready, 'prototype') === false).toBe(true);
211211
});
212-
test('ready function should contain all userProxy properties :', () => {
213-
const readyProps = Object.keys(obj.ready).join();
214-
const uesrProxyProps = Object.keys(obj.userProxy).join();
215-
expect(uesrProxyProps === readyProps).toBe(true);
216-
});
217212
test('its type should be a function', () => {
218213
expect(typeof obj.ready === 'function').toBe(true);
219214
});

0 commit comments

Comments
 (0)