Skip to content

Commit 59231f9

Browse files
author
Jannick Garthen
committed
fix(ObserveViewport): fix server side rendering
Using default it was working on the client, using non default it was working on the server. No method worked on both. This should fix it for now.
1 parent 629e719 commit 59231f9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/ObserveViewport.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import * as React from 'react';
2-
const memoize = require('memoize-one').default;
2+
const memoizeOne = require('memoize-one');
3+
const memoize =
4+
typeof memoizeOne === 'function' ? memoizeOne : memoizeOne.default;
35
const raf = require('raf');
46

57
import { shallowEqualScroll, shallowEqualDimensions } from './utils';

0 commit comments

Comments
 (0)