Skip to content

Commit

Permalink
fix: fix issue with useWindowDimensions been undefined on SSR
Browse files Browse the repository at this point in the history
  • Loading branch information
JonatanSalas committed Jun 14, 2021
1 parent 8d6262e commit d4beb99
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions docs/src/hooks/useWindowDimensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ const getWindowDimensions = () => {
height,
};
}

// set hardcode values to fix SSR
return {
width: 250,
height: 250,
}
};

export const useWindowDimensions = () => {
Expand Down

0 comments on commit d4beb99

Please sign in to comment.