mirror of
https://github.com/hanzoai/react.git
synced 2026-09-24 17:02:27 +00:00
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
This commit is contained in:
@@ -44,6 +44,7 @@ const possibleStandardNames = {
|
||||
controls: 'controls',
|
||||
controlslist: 'controlsList',
|
||||
coords: 'coords',
|
||||
credentialless: 'credentialless',
|
||||
crossorigin: 'crossOrigin',
|
||||
dangerouslysetinnerhtml: 'dangerouslySetInnerHTML',
|
||||
data: 'data',
|
||||
|
||||
@@ -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'}),
|
||||
|
||||
Reference in New Issue
Block a user