dillon1000/react

Commit

Restore old behavior for empty `href` props on anchor tags (#28124)

Treat `<a href="" />` the same with and without
`enableFilterEmptyStringAttributesDOM`

in https://github.com/facebook/react/pull/18513 we started to warn and
ignore for empty `href` and `src` props since it usually hinted at a
mistake. However, for anchor tags there's a valid use case since `<a
href=""></a>` will by spec render a link to the current page. It could
be used to reload the page without having to rely on browser
affordances.

The implementation for Fizz is in the spirit of
https://github.com/facebook/react/pull/21153. I gated the fork behind
the flag so that the fork is DCE'd when the flag is off.
Browse files
Changed paths5 files
First-parent comparison
M fixtures/attribute-behavior/AttributeTableSnapshot.md ModifiedM packages/react-dom-bindings/src/client/ReactDOMComponent.js ModifiedM packages/react-dom-bindings/src/server/ReactFizzConfigDOM.js ModifiedM packages/react-dom/src/__tests__/ReactDOMComponent-test.js ModifiedM packages/react-dom/src/__tests__/ReactDOMServerIntegrationAttributes-test.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…