From 5cff212072beb58b00e6475d1cd2d57413f73e2c Mon Sep 17 00:00:00 2001 From: ryota-murakami Date: Fri, 3 Aug 2018 13:23:07 +0900 Subject: [PATCH] add flowtype to function signature (#13285) --- .../src/ReactFiberBeginWork.js | 42 +++++++++++++++---- 1 file changed, 35 insertions(+), 7 deletions(-) diff --git a/packages/react-reconciler/src/ReactFiberBeginWork.js b/packages/react-reconciler/src/ReactFiberBeginWork.js index fb71d18581..9e8077b7a2 100644 --- a/packages/react-reconciler/src/ReactFiberBeginWork.js +++ b/packages/react-reconciler/src/ReactFiberBeginWork.js @@ -146,7 +146,11 @@ export function reconcileChildren( } } -function updateForwardRef(current, workInProgress, renderExpirationTime) { +function updateForwardRef( + current: Fiber | null, + workInProgress: Fiber, + renderExpirationTime: ExpirationTime, +) { const render = workInProgress.type.render; const nextProps = workInProgress.pendingProps; const ref = workInProgress.ref; @@ -184,7 +188,11 @@ function updateForwardRef(current, workInProgress, renderExpirationTime) { return workInProgress.child; } -function updateFragment(current, workInProgress, renderExpirationTime) { +function updateFragment( + current: Fiber | null, + workInProgress: Fiber, + renderExpirationTime: ExpirationTime, +) { const nextChildren = workInProgress.pendingProps; reconcileChildren( current, @@ -196,7 +204,11 @@ function updateFragment(current, workInProgress, renderExpirationTime) { return workInProgress.child; } -function updateMode(current, workInProgress, renderExpirationTime) { +function updateMode( + current: Fiber | null, + workInProgress: Fiber, + renderExpirationTime: ExpirationTime, +) { const nextChildren = workInProgress.pendingProps.children; reconcileChildren( current, @@ -208,7 +220,11 @@ function updateMode(current, workInProgress, renderExpirationTime) { return workInProgress.child; } -function updateProfiler(current, workInProgress, renderExpirationTime) { +function updateProfiler( + current: Fiber | null, + workInProgress: Fiber, + renderExpirationTime: ExpirationTime, +) { if (enableProfilerTimer) { workInProgress.effectTag |= Update; } @@ -768,7 +784,11 @@ function updatePlaceholderComponent( } } -function updatePortalComponent(current, workInProgress, renderExpirationTime) { +function updatePortalComponent( + current: Fiber | null, + workInProgress: Fiber, + renderExpirationTime: ExpirationTime, +) { pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); const nextChildren = workInProgress.pendingProps; if (current === null) { @@ -796,7 +816,11 @@ function updatePortalComponent(current, workInProgress, renderExpirationTime) { return workInProgress.child; } -function updateContextProvider(current, workInProgress, renderExpirationTime) { +function updateContextProvider( + current: Fiber | null, + workInProgress: Fiber, + renderExpirationTime: ExpirationTime, +) { const providerType: ReactProviderType = workInProgress.type; const context: ReactContext = providerType._context; @@ -859,7 +883,11 @@ function updateContextProvider(current, workInProgress, renderExpirationTime) { return workInProgress.child; } -function updateContextConsumer(current, workInProgress, renderExpirationTime) { +function updateContextConsumer( + current: Fiber | null, + workInProgress: Fiber, + renderExpirationTime: ExpirationTime, +) { const context: ReactContext = workInProgress.type; const newProps = workInProgress.pendingProps; const render = newProps.children;