We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6200176 commit 71f8764Copy full SHA for 71f8764
src/hooks/useController.ts
@@ -2,8 +2,12 @@ import { useContext } from 'react';
2
import { ParallaxController } from 'parallax-controller';
3
import { ParallaxContext } from '../context/ParallaxContext';
4
5
-export function useController(): ParallaxController {
+export function useController(): ParallaxController | {} {
6
const parallaxController = useContext(ParallaxContext);
7
+ const isServer = typeof window === 'undefined';
8
+ if (isServer) {
9
+ return {};
10
+ }
11
12
if (!parallaxController) {
13
throw new Error(
0 commit comments