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 88913a5 commit 29abccdCopy full SHA for 29abccd
packages/app/src/app/pages/Sandbox/Editor/Content/Preview/index.tsx
@@ -1,6 +1,7 @@
1
// @flow
2
import React, { useState, useCallback, useEffect } from 'react';
3
import _property from 'lodash/property';
4
+import _isFunction from 'lodash/isFunction';
5
import { useOvermind } from 'app/overmind';
6
7
import BasePreview from '@codesandbox/common/lib/components/Preview';
@@ -23,7 +24,9 @@ const useForceUpdate = () => {
23
24
);
25
26
useEffect(() => {
- callback();
27
+ if (_isFunction(callback)) {
28
+ callback();
29
+ }
30
}, [callback]);
31
32
return forceUpdate;
0 commit comments