Skip to content

Commit 12d6c86

Browse files
committed
fix: Fixed ScrollReveal not working at theme after update
1 parent e4abeb0 commit 12d6c86

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/ScrollReveal/index.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ export class ScrollReveal extends React.Component<ScrollRevealProps> {
6969
this.context.theme.scrollReveals.push(this as any);
7070
}
7171

72+
componentDidUpdate() {
73+
if (!this.context.theme.scrollReveals.includes(this as any)) {
74+
this.context.theme.scrollReveals.push(this as any);
75+
}
76+
}
77+
7278
componentWillUnmount() {
7379
const { scrollReveals } = this.context.theme;
7480
scrollReveals.splice(scrollReveals.indexOf(this as any), 1);

0 commit comments

Comments
 (0)