Skip to content

Commit

Permalink
fix: make window check SSR safe (#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
johakr committed Jun 29, 2022
1 parent c623142 commit 9b29b13
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/countUp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export class CountUp {
}

// scroll spy
if (window !== undefined && this.options.enableScrollSpy) {
if (typeof window !== 'undefined' && this.options.enableScrollSpy) {
if (!this.error) {
// set up global array of onscroll functions
window['onScrollFns'] = window['onScrollFns'] || [];
Expand Down

0 comments on commit 9b29b13

Please sign in to comment.