diff --git a/packages/react-dom-bindings/src/client/ReactDOMComponent.js b/packages/react-dom-bindings/src/client/ReactDOMComponent.js index 81ecb2685cefb..24083f509981c 100644 --- a/packages/react-dom-bindings/src/client/ReactDOMComponent.js +++ b/packages/react-dom-bindings/src/client/ReactDOMComponent.js @@ -712,7 +712,7 @@ function setProp( case 'disableRemotePlayback': case 'formNoValidate': case 'hidden': - case 'inert': + case enableNewBooleanProps ? 'inert' : 'formNoValidate': case 'loop': case 'noModule': case 'noValidate': @@ -724,18 +724,14 @@ function setProp( case 'scoped': case 'seamless': case 'itemScope': { - const isNewBooleanProp = key === 'inert'; - if (enableNewBooleanProps || !isNewBooleanProp) { - if (value && typeof value !== 'function' && typeof value !== 'symbol') { - domElement.setAttribute(key, ''); - } else { - domElement.removeAttribute(key); - } - break; + if (value && typeof value !== 'function' && typeof value !== 'symbol') { + domElement.setAttribute(key, ''); + } else { + domElement.removeAttribute(key); } + break; } // Overloaded Boolean - // eslint-disable-next-line no-fallthrough -- Re-enable once enableNewBooleanProps is removed. case 'capture': case 'download': { // An attribute that can be used as a flag as well as with a value. @@ -2491,7 +2487,7 @@ function diffHydratedGenericElement( case 'disableRemotePlayback': case 'formNoValidate': case 'hidden': - case 'inert': + case enableNewBooleanProps ? 'inert' : 'formNoValidate': case 'loop': case 'noModule': case 'noValidate': @@ -2503,20 +2499,16 @@ function diffHydratedGenericElement( case 'scoped': case 'seamless': case 'itemScope': { - const isNewBooleanProp = propKey === 'inert'; - if (enableNewBooleanProps || !isNewBooleanProp) { - // Some of these need to be lower case to remove them from the extraAttributes list. - hydrateBooleanAttribute( - domElement, - propKey, - propKey.toLowerCase(), - value, - extraAttributes, - ); - continue; - } + // Some of these need to be lower case to remove them from the extraAttributes list. + hydrateBooleanAttribute( + domElement, + propKey, + propKey.toLowerCase(), + value, + extraAttributes, + ); + continue; } - // eslint-disable-next-line no-fallthrough -- Re-enable once enableNewBooleanProps is removed. case 'capture': case 'download': { hydrateOverloadedBooleanAttribute( diff --git a/packages/react-dom-bindings/src/server/ReactFizzConfigDOM.js b/packages/react-dom-bindings/src/server/ReactFizzConfigDOM.js index 40f0774f08a51..0739ee2d8e571 100644 --- a/packages/react-dom-bindings/src/server/ReactFizzConfigDOM.js +++ b/packages/react-dom-bindings/src/server/ReactFizzConfigDOM.js @@ -1295,7 +1295,7 @@ function pushAttribute( case 'disableRemotePlayback': case 'formNoValidate': case 'hidden': - case 'inert': + case enableNewBooleanProps ? 'inert' : 'formNoValidate': case 'loop': case 'noModule': case 'noValidate': @@ -1307,20 +1307,16 @@ function pushAttribute( case 'scoped': case 'seamless': case 'itemScope': { - const isNewBooleanProp = name === 'inert'; - if (enableNewBooleanProps || !isNewBooleanProp) { - // Boolean - if (value && typeof value !== 'function' && typeof value !== 'symbol') { - target.push( - attributeSeparator, - stringToChunk(name), - attributeEmptyString, - ); - } - return; + // Boolean + if (value && typeof value !== 'function' && typeof value !== 'symbol') { + target.push( + attributeSeparator, + stringToChunk(name), + attributeEmptyString, + ); } + return; } - // eslint-disable-next-line no-fallthrough -- Re-enable once enableNewBooleanProps is removed. case 'capture': case 'download': { // Overloaded Boolean diff --git a/packages/react-dom-bindings/src/shared/ReactDOMUnknownPropertyHook.js b/packages/react-dom-bindings/src/shared/ReactDOMUnknownPropertyHook.js index cb7f47e9a7e77..8f8f9ae9f2580 100644 --- a/packages/react-dom-bindings/src/shared/ReactDOMUnknownPropertyHook.js +++ b/packages/react-dom-bindings/src/shared/ReactDOMUnknownPropertyHook.js @@ -224,6 +224,7 @@ function validateProperty(tagName, name, value, eventRegistry) { case 'disableRemotePlayback': case 'formNoValidate': case 'hidden': + case enableNewBooleanProps ? 'inert' : 'formNoValidate': case 'loop': case 'noModule': case 'noValidate': @@ -241,10 +242,6 @@ function validateProperty(tagName, name, value, eventRegistry) { return true; } default: { - // TODO: Move into above cases once enableNewBooleanProps is removed. - if (enableNewBooleanProps && name === 'inert') { - return true; - } const prefix = name.toLowerCase().slice(0, 5); if (prefix === 'data-' || prefix === 'aria-') { return true; @@ -305,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': @@ -318,11 +316,6 @@ function validateProperty(tagName, name, value, eventRegistry) { case 'itemScope': { break; } - case 'inert': - if (enableNewBooleanProps) { - break; - } - // eslint-disable-next-line no-fallthrough -- not flagged after DCE default: { return true; }