Skip to content

Commit 6fd6f02

Browse files
Remove Deprecated parameter of onChange option
1 parent c3eb1ff commit 6fd6f02

File tree

3 files changed

+1
-11
lines changed

3 files changed

+1
-11
lines changed

README.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ React Dynamic Tabs with full API
6969
- [Render custom components at the end of the Tablist](#render-custom-components-at-the-end-of-the-tablist)
7070
- [Styling](#styling)
7171
- [Caveats](#caveats)
72-
- [Deprecated features](#deprecated-features)
7372
- [Test](#test)
7473
- [License](#license)
7574

@@ -1305,12 +1304,6 @@ Include `react-dyn-tabs/style/react-dyn-tabs-rtl.min.css` for `rtl` mode
13051304

13061305
- Do not use setState inside the onInit callback because it leads to an infinite loop.
13071306

1308-
## Deprecated features
1309-
1310-
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.
1311-
1312-
- First parameter of onChange function is an object and has perviousData property which is deprecated. you should use previousData property instead of perviousData property.
1313-
13141307
## Test
13151308

13161309
```js

src/index.test.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ describe('onInit callback : ', () => {
550550
});
551551
});
552552
describe('onChange callback : ', () => {
553-
test(`onChange is called with {currentData,previousData,perviousData,openedTabIDs,closedTabIDs}
553+
test(`onChange is called with {currentData,previousData,openedTabIDs,closedTabIDs}
554554
object as a parameter`, () => {
555555
renderApp();
556556
act(() => {
@@ -560,7 +560,6 @@ describe('onChange callback : ', () => {
560560
expect(op.onChange.mock.calls[0][0]).toEqual({
561561
currentData: {selectedTabID: '2', openTabIDs: ['1', '2']},
562562
previousData: {selectedTabID: '1', openTabIDs: ['1', '2']},
563-
perviousData: {selectedTabID: '1', openTabIDs: ['1', '2']},
564563
openedTabIDs: [],
565564
closedTabIDs: [],
566565
});
@@ -615,7 +614,6 @@ describe('onChange callback : ', () => {
615614
expect(onChange2.mock.calls[0][0]).toEqual({
616615
currentData: {selectedTabID: '3', openTabIDs: ['1', '3']},
617616
previousData: {selectedTabID: '1', openTabIDs: ['1', '2']},
618-
perviousData: {selectedTabID: '1', openTabIDs: ['1', '2']},
619617
closedTabIDs: ['2'],
620618
openedTabIDs: ['3'],
621619
});

src/utils/api/api.factory.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@ Helper.setNoneEnumProps(_apiProps, {
190190
{
191191
currentData: this.helper.getCopyState(newState),
192192
previousData: this.helper.getCopyState(oldState),
193-
perviousData: this.helper.getCopyState(oldState),
194193
closedTabIDs: closedTabIDs.slice(),
195194
openedTabIDs: openedTabIDs.slice(),
196195
},

0 commit comments

Comments
 (0)