Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/eslint-plugin-react-hooks/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

This release adds ESLint v10 support, improves performance by skipping compilation for non-React files, and includes compiler lint improvements including better `set-state-in-effect` detection, improved ref validation, and more helpful error reporting.

- Add ESLint v10 support. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo) in [#35720](https://github.com/facebook/react/pull/35720))
- Add ESLint v10 support. ([@azat-io](https://github.com/azat-io) in [#35720](https://github.com/facebook/react/pull/35720))
- Skip compilation for non-React files to improve performance. ([@josephsavona](https://github.com/josephsavona) in [#35589](https://github.com/facebook/react/pull/35589))
- Fix exhaustive deps bug with Flow type casting. ([@jorge-cab](https://github.com/jorge-cab) in [#35691](https://github.com/facebook/react/pull/35691))
- Fix `useEffectEvent` checks in component syntax. ([@jbrown215](https://github.com/jbrown215) in [#35041](https://github.com/facebook/react/pull/35041))
Expand Down
2 changes: 2 additions & 0 deletions packages/react-dom-bindings/src/client/ReactDOMComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,7 @@ function setProp(
case 'async':
case 'autoPlay':
case 'controls':
case 'credentialless':
case 'default':
case 'defer':
case 'disabled':
Expand Down Expand Up @@ -2849,6 +2850,7 @@ function diffHydratedGenericElement(
case 'async':
case 'autoPlay':
case 'controls':
case 'credentialless':
case 'default':
case 'defer':
case 'disabled':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1695,6 +1695,7 @@ function pushAttribute(
case 'async':
case 'autoPlay':
case 'controls':
case 'credentialless':
case 'default':
case 'defer':
case 'disabled':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ function validateProperty(tagName, name, value, eventRegistry) {
case 'async':
case 'autoPlay':
case 'controls':
case 'credentialless':
case 'default':
case 'defer':
case 'disabled':
Expand Down Expand Up @@ -287,6 +288,7 @@ function validateProperty(tagName, name, value, eventRegistry) {
case 'async':
case 'autoPlay':
case 'controls':
case 'credentialless':
case 'default':
case 'defer':
case 'disabled':
Expand Down
28 changes: 28 additions & 0 deletions packages/react-dom/src/__tests__/DOMPropertyOperations-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,34 @@ describe('DOMPropertyOperations', () => {
expect(container.firstChild.hasAttribute('allowFullScreen')).toBe(false);
});

it('should set credentialless boolean attribute on iframes', async () => {
const container = document.createElement('div');
const root = ReactDOMClient.createRoot(container);
await act(() => {
root.render(<iframe credentialless={true} />);
});
expect(container.firstChild.getAttribute('credentialless')).toBe('');
await act(() => {
root.render(<iframe credentialless={false} />);
});
expect(container.firstChild.hasAttribute('credentialless')).toBe(false);
});

it('should set credentialless attribute when passed a string and warn', async () => {
const container = document.createElement('div');
const root = ReactDOMClient.createRoot(container);
await act(() => {
root.render(<iframe credentialless="true" />);
});
assertConsoleErrorDev([
'Received the string `true` for the boolean attribute `credentialless`. ' +
'Although this works, it will not work as expected if you pass the string "false". ' +
'Did you mean credentialless={true}?\n' +
' in iframe (at **)',
]);
expect(container.firstChild.getAttribute('credentialless')).toBe('');
});

it('should remove when setting custom attr to null', async () => {
const container = document.createElement('div');
const root = ReactDOMClient.createRoot(container);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,18 @@ describe('ReactDOMServerIntegration', () => {
});
});

describe('credentialless property', function () {
itRenders('credentialless prop with true value', async render => {
const e = await render(<iframe credentialless={true} />);
expect(e.getAttribute('credentialless')).toBe('');
});

itRenders('credentialless prop with false value', async render => {
const e = await render(<iframe credentialless={false} />);
expect(e.hasAttribute('credentialless')).toBe(false);
});
});

describe('download property (combined boolean/string attribute)', function () {
itRenders('download prop with true value', async render => {
const e = await render(<a download={true} />);
Expand Down
Loading