Skip to content

Commit c3eb1ff

Browse files
Remove Deprecated parameter of onSelect option
1 parent dae41c2 commit c3eb1ff

File tree

3 files changed

+1
-8
lines changed

3 files changed

+1
-8
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-
- First parameter of onSelect function is an object and has perviousSelectedTabId property which is deprecated. you should use previousSelectedTabId property instead of perviousSelectedTabId property.
1313-
13141312
- First parameter of onChange function is an object and has perviousData property which is deprecated. you should use previousData property instead of perviousData property.
13151313

13161314
## Test

src/index.test.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,6 @@ describe('select method : ', () => {
282282
expect(op.onSelect.mock.calls.length === 1).toBe(true);
283283
expect(onSelect.mock.calls[0][0]).toEqual({
284284
currentSelectedTabId: '2',
285-
perviousSelectedTabId: '1',
286285
previousSelectedTabId: '1',
287286
});
288287
expect(op.onInit).toHaveBeenCalledBefore(op.onChange);
@@ -605,7 +604,6 @@ describe('onChange callback : ', () => {
605604

606605
expect(onSelect.mock.calls[0][0]).toEqual({
607606
currentSelectedTabId: '3',
608-
perviousSelectedTabId: '1',
609607
previousSelectedTabId: '1',
610608
});
611609
expect(onFirstSelect.mock.calls[0][0]).toEqual({
@@ -636,15 +634,14 @@ describe('onChange callback : ', () => {
636634
});
637635
});
638636
describe('onSelect callback : ', () => {
639-
test('onSelect is called with {currentSelectedTabId,previousSelectedTabId,perviousSelectedTabId} object as a parameter', () => {
637+
test('onSelect is called with {currentSelectedTabId,previousSelectedTabId} object as a parameter', () => {
640638
renderApp();
641639
act(() => {
642640
instance.select('2');
643641
});
644642
expect(op.onSelect.mock.calls.length).toBe(1);
645643
expect(op.onSelect.mock.calls[0][0]).toEqual({
646644
currentSelectedTabId: '2',
647-
perviousSelectedTabId: '1',
648645
previousSelectedTabId: '1',
649646
});
650647
});
@@ -668,7 +665,6 @@ describe('onSelect callback : ', () => {
668665
});
669666
expect(onSelect2.mock.calls[0][0]).toEqual({
670667
currentSelectedTabId: '2',
671-
perviousSelectedTabId: '1',
672668
previousSelectedTabId: '1',
673669
});
674670
});

src/utils/api/api.factory.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,6 @@ Helper.setNoneEnumProps(_apiProps, {
220220
{
221221
currentSelectedTabId: newState.selectedTabID,
222222
previousSelectedTabId: oldState.selectedTabID,
223-
perviousSelectedTabId: oldState.selectedTabID,
224223
},
225224
];
226225
});

0 commit comments

Comments
 (0)