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 e06ce45 commit 6796769Copy full SHA for 6796769
src/components/Parallax/hooks.ts
@@ -3,10 +3,11 @@ import { useEffect } from 'react';
3
4
export function useVerifyController(controller: ParallaxController) {
5
useEffect(() => {
6
+ const isServer = typeof window === 'undefined';
7
// Make sure the provided controller is an instance of the Parallax Controller
8
const isInstance = controller instanceof ParallaxController;
9
// Throw if neither context or global is available
- if (!controller && !isInstance) {
10
+ if (!isServer && !controller && !isInstance) {
11
throw new Error(
12
"Must wrap your application's <Parallax /> components in a <ParallaxProvider />."
13
);
0 commit comments