diff --git a/packages/react-dom-bindings/src/client/ReactDOMComponent.js b/packages/react-dom-bindings/src/client/ReactDOMComponent.js index 2e251a2602d73..5145b7b8eca28 100644 --- a/packages/react-dom-bindings/src/client/ReactDOMComponent.js +++ b/packages/react-dom-bindings/src/client/ReactDOMComponent.js @@ -72,6 +72,7 @@ import { disableIEWorkarounds, enableTrustedTypesIntegration, enableFilterEmptyStringAttributesDOM, + enableNewBooleanProps, } from 'shared/ReactFeatureFlags'; import { mediaEventTypes, @@ -715,7 +716,7 @@ function setProp( case 'disableRemotePlayback': case 'formNoValidate': case 'hidden': - case 'inert': + case enableNewBooleanProps ? 'inert' : 'formNoValidate': case 'loop': case 'noModule': case 'noValidate': @@ -2494,6 +2495,7 @@ function diffHydratedGenericElement( case 'disableRemotePlayback': case 'formNoValidate': case 'hidden': + case enableNewBooleanProps ? 'inert' : 'formNoValidate': case 'loop': case 'noModule': case 'noValidate': diff --git a/packages/react-dom-bindings/src/server/ReactFizzConfigDOM.js b/packages/react-dom-bindings/src/server/ReactFizzConfigDOM.js index b6fe8d9109a6f..0b6aacf38a3ea 100644 --- a/packages/react-dom-bindings/src/server/ReactFizzConfigDOM.js +++ b/packages/react-dom-bindings/src/server/ReactFizzConfigDOM.js @@ -33,6 +33,7 @@ import { enableFloat, enableFormActions, enableFizzExternalRuntime, + enableNewBooleanProps, } from 'shared/ReactFeatureFlags'; import type { @@ -1289,6 +1290,7 @@ function pushAttribute( case 'disableRemotePlayback': case 'formNoValidate': case 'hidden': + case enableNewBooleanProps ? 'inert' : 'formNoValidate': case 'loop': case 'noModule': case 'noValidate': diff --git a/packages/react-dom-bindings/src/shared/ReactDOMUnknownPropertyHook.js b/packages/react-dom-bindings/src/shared/ReactDOMUnknownPropertyHook.js index 7226d3403cda2..8f8f9ae9f2580 100644 --- a/packages/react-dom-bindings/src/shared/ReactDOMUnknownPropertyHook.js +++ b/packages/react-dom-bindings/src/shared/ReactDOMUnknownPropertyHook.js @@ -12,6 +12,7 @@ import hasOwnProperty from 'shared/hasOwnProperty'; import { enableCustomElementPropertySupport, enableFormActions, + enableNewBooleanProps, } from 'shared/ReactFeatureFlags'; const warnedProperties = {}; @@ -223,7 +224,7 @@ function validateProperty(tagName, name, value, eventRegistry) { case 'disableRemotePlayback': case 'formNoValidate': case 'hidden': - case 'inert': + case enableNewBooleanProps ? 'inert' : 'formNoValidate': case 'loop': case 'noModule': case 'noValidate': @@ -301,6 +302,7 @@ function validateProperty(tagName, name, value, eventRegistry) { case 'disableRemotePlayback': case 'formNoValidate': case 'hidden': + case enableNewBooleanProps ? 'inert' : 'formNoValidate': case 'loop': case 'noModule': case 'noValidate': diff --git a/packages/react-dom-bindings/src/shared/possibleStandardNames.js b/packages/react-dom-bindings/src/shared/possibleStandardNames.js index 6c06b47c64ac7..d2d90877b53d7 100644 --- a/packages/react-dom-bindings/src/shared/possibleStandardNames.js +++ b/packages/react-dom-bindings/src/shared/possibleStandardNames.js @@ -4,6 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ +import {enableNewBooleanProps} from 'shared/ReactFeatureFlags'; // When adding attributes to the HTML or SVG allowed attribute list, be sure to // also add them to this module to ensure casing and incorrect name @@ -82,7 +83,6 @@ const possibleStandardNames = { id: 'id', imagesizes: 'imageSizes', imagesrcset: 'imageSrcSet', - inert: 'inert', innerhtml: 'innerHTML', inputmode: 'inputMode', integrity: 'integrity', @@ -503,4 +503,8 @@ const possibleStandardNames = { zoomandpan: 'zoomAndPan', }; +if (enableNewBooleanProps) { + possibleStandardNames.inert = 'inert'; +} + export default possibleStandardNames; diff --git a/packages/shared/ReactFeatureFlags.js b/packages/shared/ReactFeatureFlags.js index 689e26568779d..675bdd871e5aa 100644 --- a/packages/shared/ReactFeatureFlags.js +++ b/packages/shared/ReactFeatureFlags.js @@ -208,6 +208,13 @@ export const disableInputAttributeSyncing = false; // Disables children for