Skip to content

Commit 1a49930

Browse files
author
Sebastian Silbermann
committed
Fix Flow types
1 parent 9fd9496 commit 1a49930

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/react-debug-tools/src/ReactDebugHooks.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,11 @@ function getPrimitiveStackCache(): Map<string, Array<any>> {
8080
// This type check is for Flow only.
8181
Dispatcher.useMemoCache(0);
8282
}
83-
Dispatcher.useOptimistic(0);
83+
84+
if (typeof Dispatcher.useOptimistic === 'function') {
85+
// This type check is for Flow only.
86+
Dispatcher.useOptimistic(null, (s: mixed, a: mixed) => s);
87+
}
8488
} finally {
8589
readHookLog = hookLog;
8690
hookLog = [];

0 commit comments

Comments
 (0)