Skip to content

Commit da72502

Browse files
author
Brian Vaughn
committed
Imported bugfix from facebook/react/pull/14940
1 parent ded997e commit da72502

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/backend/ReactDebugHooks.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ function readContext<T>(
8787
}
8888

8989
function useContext<T>(context: any, observedBits: void | number | boolean): T {
90+
if (__DEV__) {
91+
// ReactFiberHooks only adds context to the hooks list in DEV.
92+
nextHook();
93+
}
9094
hookLog.push({
9195
primitive: 'Context',
9296
stackError: new Error(),

0 commit comments

Comments
 (0)