Skip to content

Commit 9dd2bbd

Browse files
Merge pull request #102 from tuckergordon/remove-defaultprops
Remove `defaultProps`
2 parents 8517fda + 220d922 commit 9dd2bbd

File tree

2 files changed

+8
-22
lines changed

2 files changed

+8
-22
lines changed

src/Scrollama.js

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ const Scrollama = props => {
1616
const {
1717
debug,
1818
children,
19-
offset,
20-
onStepEnter,
21-
onStepExit,
22-
onStepProgress,
23-
threshold,
19+
offset = 0.3,
20+
onStepEnter = () => {},
21+
onStepExit = () => {},
22+
onStepProgress = null,
23+
threshold = 4,
2424
} = props;
2525
const isOffsetDefinedInPixels = isOffsetInPixels(offset)
2626
const [lastScrollTop, setLastScrollTop] = useState(0);
@@ -72,12 +72,4 @@ const Scrollama = props => {
7272
);
7373
};
7474

75-
Scrollama.defaultProps = {
76-
onStepProgress: null,
77-
onStepEnter: () => {},
78-
onStepExit: () => {},
79-
threshold: 4,
80-
offset: 0.3,
81-
};
82-
8375
export default Scrollama;

src/Step.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ const Step = props => {
1818
data,
1919
handleSetLastScrollTop,
2020
lastScrollTop,
21-
onStepEnter,
22-
onStepExit,
23-
onStepProgress,
21+
onStepEnter = () => {},
22+
onStepExit = () => {},
23+
onStepProgress = null,
2424
offset,
2525
scrollamaId,
2626
progressThreshold,
@@ -96,10 +96,4 @@ const Step = props => {
9696
});
9797
};
9898

99-
Step.defaultProps = {
100-
onStepProgress: null,
101-
onStepEnter: () => {},
102-
onStepExit: () => {},
103-
};
104-
10599
export default Step;

0 commit comments

Comments
 (0)