Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 60efc15

Browse files
don’t throw on server in useController #125
1 parent df1b1cc commit 60efc15

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

‎src/components/useController.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ import ParallaxContext from '../helpers/ParallaxContext';
33

44
export default () => {
55
const parallaxController = useContext(ParallaxContext);
6+
const isServer = typeof window === 'undefined';
7+
if (isServer) {
8+
return null;
9+
}
610

711
if (!parallaxController) {
812
throw new Error(

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /