We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 056d631 commit 8f41e98Copy full SHA for 8f41e98
packages/react/src/ReactContext.js
@@ -30,6 +30,8 @@ export function createContext<T>(defaultValue: T): ReactContext<T> {
30
// These are circular
31
Provider: (null: any),
32
Consumer: (null: any),
33
+ // Temporary for backwards compat:
34
+ _context: null,
35
};
36
37
context.Provider = context;
@@ -38,6 +40,10 @@ export function createContext<T>(defaultValue: T): ReactContext<T> {
38
40
_context: context,
39
41
42
43
+ // Some tooling (e.g. DevTools) may assume that context.Provider._context === context.
44
+ // Keep that true for now to avoid excessive breakage.
45
+ context._context = context;
46
+
47
if (__DEV__) {
48
context._currentRenderer = null;
49
context._currentRenderer2 = null;
0 commit comments