Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

Commit

Permalink
ssr fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
EderOBarreto committed Jul 11, 2022
1 parent f3b162c commit 9c25717
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/hooks/useWindowDimensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ export interface WindowDimensions {
const getWindowDimensions = (): WindowDimensions => {
let width = 0
let height = 0
let rootFontSize = 16

if (typeof window !== 'undefined') {
width = window?.innerWidth
height = window?.innerHeight
rootFontSize = parseInt(getComputedStyle(document?.documentElement)?.fontSize) ?? 16
}

const rootFontSize = parseInt(getComputedStyle(document?.documentElement)?.fontSize) ?? 16

return {
width: {
px: width,
Expand Down

0 comments on commit 9c25717

Please sign in to comment.