From d4beb9962671c392675125c69920a5d32ccd9445 Mon Sep 17 00:00:00 2001 From: JonatanSalas Date: Mon, 14 Jun 2021 00:56:56 -0300 Subject: [PATCH] fix: fix issue with useWindowDimensions been undefined on SSR --- docs/package-lock.json | 7 +++++++ docs/src/hooks/useWindowDimensions.js | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/docs/package-lock.json b/docs/package-lock.json index 48585ad..4ef401e 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -4047,6 +4047,7 @@ "dependencies": { "anymatch": "~3.1.1", "braces": "~3.0.2", + "fsevents": "~2.3.1", "glob-parent": "~5.1.0", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", @@ -8317,6 +8318,7 @@ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", "dependencies": { + "graceful-fs": "^4.1.6", "universalify": "^2.0.0" }, "optionalDependencies": { @@ -10562,6 +10564,9 @@ "version": "1.23.0", "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.23.0.tgz", "integrity": "sha512-c29LVsqOaLbBHuIbsTxaKENh1N2EQBOHaWv7gkHN4dgRbxSREqDnDbtFJYdpPauS4YCplMSNCABQ6Eeor69bAA==", + "dependencies": { + "clipboard": "^2.0.0" + }, "optionalDependencies": { "clipboard": "^2.0.0" } @@ -14403,6 +14408,7 @@ "anymatch": "^2.0.0", "async-each": "^1.0.1", "braces": "^2.3.2", + "fsevents": "^1.2.7", "glob-parent": "^3.1.0", "inherits": "^2.0.3", "is-binary-path": "^1.0.0", @@ -23955,6 +23961,7 @@ "chalk": "^4.1.0", "find-up": "^5.0.0", "mkdirp": "^1.0.4", + "postcss": "^8.2.4", "strip-json-comments": "^3.1.1" }, "dependencies": { diff --git a/docs/src/hooks/useWindowDimensions.js b/docs/src/hooks/useWindowDimensions.js index c7a7968..afa70e1 100644 --- a/docs/src/hooks/useWindowDimensions.js +++ b/docs/src/hooks/useWindowDimensions.js @@ -9,6 +9,12 @@ const getWindowDimensions = () => { height, }; } + + // set hardcode values to fix SSR + return { + width: 250, + height: 250, + } }; export const useWindowDimensions = () => {