Skip to content

Commit 26d7822

Browse files
committed
Move checks inside
1 parent 133a4b5 commit 26d7822

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

packages/react-reconciler/src/ReactFiberContext.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,12 @@ function hasContextChanged(): boolean {
134134
}
135135

136136
function isContextProvider(type: Function): boolean {
137-
const childContextTypes = type.childContextTypes;
138-
const hasChildContextTypes =
139-
childContextTypes !== null && childContextTypes !== undefined;
140137
if (disableLegacyContext) {
141138
return false;
142139
} else {
140+
const childContextTypes = type.childContextTypes;
141+
const hasChildContextTypes =
142+
childContextTypes !== null && childContextTypes !== undefined;
143143
return hasChildContextTypes;
144144
}
145145
}

0 commit comments

Comments
 (0)