Skip to content
Merged
Prev Previous commit
Next Next commit
Fix flow issues
  • Loading branch information
sammy-SC committed Aug 23, 2022
commit c24c0a30fcad82744c83010e9680baa72ae1ce04
7 changes: 4 additions & 3 deletions packages/react-reconciler/src/ReactFiberCommitWork.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ import {
setIsRunningInsertionEffect,
getExecutionContext,
CommitContext,
NoContext,
} from './ReactFiberWorkLoop.new';
import {
NoFlags as NoHookEffect,
Expand Down Expand Up @@ -201,12 +202,12 @@ let nextEffect: Fiber | null = null;
let inProgressLanes: Lanes | null = null;
let inProgressRoot: FiberRoot | null = null;

function shouldProfile(current: Fiber): Boolean {
function shouldProfile(current: Fiber): boolean {
return (
enableProfilerTimer &&
enableProfilerCommitHooks &&
current.mode & ProfileMode &&
getExecutionContext() & CommitContext
(current.mode & ProfileMode) !== NoMode &&
(getExecutionContext() & CommitContext) !== NoContext
);
}

Expand Down
7 changes: 4 additions & 3 deletions packages/react-reconciler/src/ReactFiberCommitWork.old.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ import {
setIsRunningInsertionEffect,
getExecutionContext,
CommitContext,
NoContext,
} from './ReactFiberWorkLoop.old';
import {
NoFlags as NoHookEffect,
Expand Down Expand Up @@ -201,12 +202,12 @@ let nextEffect: Fiber | null = null;
let inProgressLanes: Lanes | null = null;
let inProgressRoot: FiberRoot | null = null;

function shouldProfile(current: Fiber): Boolean {
function shouldProfile(current: Fiber): boolean {
return (
enableProfilerTimer &&
enableProfilerCommitHooks &&
current.mode & ProfileMode &&
getExecutionContext() & CommitContext
(current.mode & ProfileMode) !== NoMode &&
(getExecutionContext() & CommitContext) !== NoContext
);
}

Expand Down