@samitouri / QOS-React-2 / commits / 8ca82e1df6

Fixed arity issues in advance of Flow strict checking being enabled (#9816)

Brian Vaughn committed May 30, 2017 at 13:50 UTC 8ca82e1df6715ab10ea1bb0c1f9af9611c837a7e
6 files changed +17 -25
src/renderers/shared/fiber/ReactChildFiber.js
+2 -2
@@ -59,7 +59,7 @@ if (__DEV__) {
59 'Each child in an array or iterator should have a unique ' +
60 '"key" prop. See https://fb.me/react-warning-keys for ' +
61 'more information.' +
62 - (getCurrentFiberStackAddendum(child) || '');
62 + (getCurrentFiberStackAddendum() || '');
63 if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
64 return;
65 }
@@ -70,7 +70,7 @@ if (__DEV__) {
70 'Each child in an array or iterator should have a unique ' +
71 '"key" prop. See https://fb.me/react-warning-keys for ' +
72 'more information.%s',
73 - getCurrentFiberStackAddendum(child),
73 + getCurrentFiberStackAddendum(),
74 );
75 };
76 }
src/renderers/shared/fiber/ReactFiberErrorLogger.js
+1 -1
@@ -16,7 +16,7 @@ const invariant = require('fbjs/lib/invariant');
16
17 import type {CapturedError} from 'ReactFiberScheduler';
18
19 -const defaultShowDialog = () => true;
19 +const defaultShowDialog = (capturedError: CapturedError) => true;
20
21 let showDialog = defaultShowDialog;
22
src/renderers/shared/fiber/ReactFiberReconciler.js
+1 -1
@@ -50,7 +50,7 @@ type OpaqueRoot = FiberRoot;
50
51 export type HostConfig<T, P, I, TI, PI, C, CX, PL> = {
52 getRootHostContext(rootContainerInstance: C): CX,
53 - getChildHostContext(parentHostContext: CX, type: T): CX,
53 + getChildHostContext(parentHostContext: CX, type: T, instance: C): CX,
54 getPublicInstance(instance: I | TI): PI,
55
56 createInstance(
src/renderers/shared/fiber/ReactFiberScheduler.js
+6 -16
@@ -462,7 +462,7 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
462 firstEffect = finishedWork.firstEffect;
463 }
464
465 - const commitInfo = prepareForCommit();
465 + prepareForCommit();
466
467 // Commit all the side-effects within a tree. We'll do this in two passes.
468 // The first pass performs all the host insertions, updates, deletions and
@@ -474,15 +474,10 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
474 while (nextEffect !== null) {
475 let error = null;
476 if (__DEV__) {
477 - error = invokeGuardedCallback(
478 - null,
479 - commitAllHostEffects,
480 - null,
481 - finishedWork,
482 - );
477 + error = invokeGuardedCallback(null, commitAllHostEffects, null);
478 } else {
479 try {
485 - commitAllHostEffects(finishedWork);
480 + commitAllHostEffects();
481 } catch (e) {
482 error = e;
483 }
@@ -504,7 +499,7 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
499 stopCommitHostEffectsTimer();
500 }
501
507 - resetAfterCommit(commitInfo);
502 + resetAfterCommit();
503
504 // The work-in-progress tree is now the current tree. This must come after
505 // the first pass of the commit phase, so that the previous tree is still
@@ -523,15 +518,10 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
518 while (nextEffect !== null) {
519 let error = null;
520 if (__DEV__) {
526 - error = invokeGuardedCallback(
527 - null,
528 - commitAllLifeCycles,
529 - null,
530 - finishedWork,
531 - );
521 + error = invokeGuardedCallback(null, commitAllLifeCycles, null);
522 } else {
523 try {
534 - commitAllLifeCycles(finishedWork);
524 + commitAllLifeCycles();
525 } catch (e) {
526 error = e;
527 }
src/renderers/shared/stack/reconciler/CallbackQueue.js
+3 -3
@@ -28,10 +28,10 @@ var validateCallback = require('validateCallback');
28 * @implements PooledClass
29 * @internal
30 */
31 -class CallbackQueue<T> {
32 - _callbacks: ?Array<() => void>;
31 +class CallbackQueue<T, Targ> {
32 + _callbacks: ?Array<(arg: Targ) => void>;
33 _contexts: ?Array<T>;
34 - _arg: ?mixed;
34 + _arg: Targ;
35
36 constructor(arg) {
37 this._callbacks = null;
src/shared/utils/PooledClass.js
+4 -2
@@ -95,8 +95,10 @@ var addPoolingTo = function<T>(
95 CopyConstructor: Class<T>,
96 pooler: Pooler,
97 ): Class<T> & {
98 - getPooled(): /* arguments of the constructor */ T,
99 - release(): void,
98 + getPooled(
99 + ...args: $ReadOnlyArray<mixed>
100 + ): /* arguments of the constructor */ T,
101 + release(instance: mixed): void,
102 } {
103 // Casting as any so that flow ignores the actual implementation and trusts
104 // it to match the type we declared