From 94643c3b8516928e4cc7fad99912272670a0a990 Mon Sep 17 00:00:00 2001 From: vmx906 Date: Tue, 21 Apr 2026 10:33:45 +0100 Subject: [PATCH] Suggest correct casing for misspelled credentialless iframe attribute (#36322) ## Summary Follow-up to #36148 (which added credentialless as a recognized boolean attribute for iframes). Adds credentialless to possibleStandardNames so React's dev warning can suggest the correct casing when users write it as Credentialless (or another incorrect case). Includes an SSR test asserting the "Did you mean credentialless?" warning fires. ## Test plan - yarn test ReactDOMComponent passes, including the new should warn about incorrect casing on the credentialless property (ssr) case --- .../src/shared/possibleStandardNames.js | 1 + .../react-dom/src/__tests__/ReactDOMComponent-test.js | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/packages/react-dom-bindings/src/shared/possibleStandardNames.js b/packages/react-dom-bindings/src/shared/possibleStandardNames.js index b237d116e43e..e111c097c75b 100644 --- a/packages/react-dom-bindings/src/shared/possibleStandardNames.js +++ b/packages/react-dom-bindings/src/shared/possibleStandardNames.js @@ -44,6 +44,7 @@ const possibleStandardNames = { controls: 'controls', controlslist: 'controlsList', coords: 'coords', + credentialless: 'credentialless', crossorigin: 'crossOrigin', dangerouslysetinnerhtml: 'dangerouslySetInnerHTML', data: 'data', diff --git a/packages/react-dom/src/__tests__/ReactDOMComponent-test.js b/packages/react-dom/src/__tests__/ReactDOMComponent-test.js index 0f0986dde8e3..824541bb2d80 100644 --- a/packages/react-dom/src/__tests__/ReactDOMComponent-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMComponent-test.js @@ -2678,6 +2678,16 @@ describe('ReactDOMComponent', () => { ]); }); + it('should warn about incorrect casing on the credentialless property (ssr)', () => { + ReactDOMServer.renderToString( + React.createElement('iframe', {Credentialless: true}), + ); + assertConsoleErrorDev([ + 'Invalid DOM property `Credentialless`. Did you mean `credentialless`?\n' + + ' in iframe (at **)', + ]); + }); + it('should warn about incorrect casing on event handlers (ssr)', () => { ReactDOMServer.renderToString( React.createElement('input', {type: 'text', oninput: '1'}),