Skip to content

Commit 2a72516

Browse files
committed
Disable legacy context
1 parent 89021fb commit 2a72516

File tree

5 files changed

+6
-3
lines changed

5 files changed

+6
-3
lines changed

packages/react-dom/src/__tests__/ReactComponentLifeCycle-test.js

+1
Original file line numberDiff line numberDiff line change
@@ -1112,6 +1112,7 @@ describe('ReactComponentLifeCycle', () => {
11121112
});
11131113

11141114
if (!require('shared/ReactFeatureFlags').disableModulePatternComponents) {
1115+
// @gate !disableLegacyContext
11151116
it('calls effects on module-pattern component', async () => {
11161117
const log = [];
11171118

packages/react-dom/src/__tests__/ReactLegacyErrorBoundaries-test.internal.js

+1
Original file line numberDiff line numberDiff line change
@@ -832,6 +832,7 @@ describe('ReactLegacyErrorBoundaries', () => {
832832
});
833833

834834
if (!require('shared/ReactFeatureFlags').disableModulePatternComponents) {
835+
// @gate !disableLegacyContext
835836
// @gate !disableLegacyMode
836837
it('renders an error state if module-style context provider throws in componentWillMount', () => {
837838
function BrokenComponentWillMountWithContext() {

packages/react-reconciler/src/__tests__/ReactIncrementalErrorHandling-test.internal.js

+1
Original file line numberDiff line numberDiff line change
@@ -1755,6 +1755,7 @@ describe('ReactIncrementalErrorHandling', () => {
17551755
});
17561756

17571757
// @gate !disableModulePatternComponents
1758+
// @gate !disableLegacyContext
17581759
it('handles error thrown inside getDerivedStateFromProps of a module-style context provider', async () => {
17591760
function Provider() {
17601761
return {

packages/shared/ReactFeatureFlags.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ export const transitionLaneExpirationMs = 5000;
140140
// -----------------------------------------------------------------------------
141141
const __NEXT_MAJOR__ = __EXPERIMENTAL__;
142142

143-
// Not ready to break experimental yet.
144-
export const disableLegacyContext = false;
143+
// Removes legacy style context
144+
export const disableLegacyContext = __NEXT_MAJOR__;
145145

146146
// Not ready to break experimental yet.
147147
// Disable javascript: URL strings in href for XSS protection.

packages/shared/forks/ReactFeatureFlags.test-renderer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ export const disableIEWorkarounds = true;
3333
export const enableScopeAPI = false;
3434
export const enableCreateEventHandleAPI = false;
3535
export const enableSuspenseCallback = false;
36-
export const disableLegacyContext = false;
3736
export const enableTrustedTypesIntegration = false;
3837
export const disableTextareaChildren = false;
3938
export const disableModulePatternComponents = false;
@@ -100,6 +99,7 @@ export const disableStringRefs = __NEXT_MAJOR__;
10099
export const enableReactTestRendererWarning = false;
101100
export const enableBigIntSupport = __NEXT_MAJOR__;
102101
export const disableLegacyMode = __NEXT_MAJOR__;
102+
export const disableLegacyContext = __NEXT_MAJOR__;
103103

104104
// Flow magic to verify the exports of this file match the original version.
105105
((((null: any): ExportsType): FeatureFlagsType): ExportsType);

0 commit comments

Comments
 (0)