@samitouri / QOS-React / commits / 0d927844fb

Type ReactDebugTool (#7586)

Flow doesn't really support the concept of variables that are non-null but only inside of a `__DEV__` block. There's an internal post about it ( https://www.facebook.com/groups/flowtype/permalink/1132437726804841/ ) and the conclusion is that we should force it to be non-null and trust the developer to put the proper DEV checks in place.

Christopher Chedeau committed Aug 27, 2016 at 14:13 UTC 0d927844fba35df4956e904fdb33e2f7a034eace
1 file changed +3 -1
src/renderers/shared/ReactInstrumentation.js
+3 -1
@@ -7,11 +7,13 @@
7 * of patent rights can be found in the PATENTS file in the same directory.
8 *
9 * @providesModule ReactInstrumentation
10 + * @flow
11 */
12
13 'use strict';
14
14 -var debugTool = null;
15 +// Trust the developer to only use ReactInstrumentation with a __DEV__ check
16 +var debugTool = ((null: any): typeof ReactDebugTool);
17
18 if (__DEV__) {
19 var ReactDebugTool = require('ReactDebugTool');