Skip to content

Commit

Permalink
Restore old behavior for empty href props on anchor tags (#28124)
Browse files Browse the repository at this point in the history
Treat `<a href="" />` the same with and without
`enableFilterEmptyStringAttributesDOM`

in #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
#21153. I gated the fork behind
the flag so that the fork is DCE'd when the flag is off.

DiffTrain build for commit f3ce87a.
  • Loading branch information
eps1lon committed Jan 30, 2024
1 parent 040cfcd commit fb59833
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25623,7 +25623,7 @@ if (__DEV__) {
return root;
}

var ReactVersion = "18.3.0-canary-af7e8c7a7-20240130";
var ReactVersion = "18.3.0-canary-f3ce87ab6-20240131";

// Might add PROFILE later.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9149,7 +9149,7 @@ var devToolsConfig$jscomp$inline_1031 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-af7e8c7a7-20240130",
version: "18.3.0-canary-f3ce87ab6-20240131",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1207 = {
Expand Down Expand Up @@ -9180,7 +9180,7 @@ var internals$jscomp$inline_1207 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-af7e8c7a7-20240130"
reconcilerVersion: "18.3.0-canary-f3ce87ab6-20240131"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1208 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9577,7 +9577,7 @@ var devToolsConfig$jscomp$inline_1073 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-af7e8c7a7-20240130",
version: "18.3.0-canary-f3ce87ab6-20240131",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1248 = {
Expand Down Expand Up @@ -9608,7 +9608,7 @@ var internals$jscomp$inline_1248 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-af7e8c7a7-20240130"
reconcilerVersion: "18.3.0-canary-f3ce87ab6-20240131"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1249 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if (__DEV__) {
) {
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
}
var ReactVersion = "18.3.0-canary-af7e8c7a7-20240130";
var ReactVersion = "18.3.0-canary-f3ce87ab6-20240131";

// ATTENTION
// When adding new symbols to this file,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -545,4 +545,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-af7e8c7a7-20240130";
exports.version = "18.3.0-canary-f3ce87ab6-20240131";
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-af7e8c7a7-20240130";
exports.version = "18.3.0-canary-f3ce87ab6-20240131";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
af7e8c7a71c60278e3935dfb20fac7b562769bb4
f3ce87ab650f07774e1df9bc3f8033e023973d10

0 comments on commit fb59833

Please sign in to comment.