Skip to content

Commit

Permalink
[Fizz] Fix children rendering in custom elements with `enableCustomEl…
Browse files Browse the repository at this point in the history
…ementPropertySupport` (#27511)

The `enableCustomElementPropertySupport` flag changes React's handling
of custom elements in a way that is more useful that just treating every
prop as an attribute. However when server rendering we have no choice
but to serialize props as attributes. When this flag is on and React
supports more prop types on the client like functions and objects the
server implementation needs to be a bit more naunced in how it renders
these components. With this flag on `false`, function, and object props
are omitted entirely and `true` is normalized to `""`. There was a bug
however in the implementation which caused children more complex than a
single string to be omitted because it matched the object type filter.
This change reorganizes the code a bit to put these filters in the
default prop handline case, leaving children, style, and innerHTML to be
handled via normal logic.

fixes: #27286

DiffTrain build for commit bb77852.
  • Loading branch information
gnoff committed Oct 12, 2023
1 parent d1f9770 commit 191c16a
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 @@ -24770,7 +24770,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-canary-ea8a8619c-20231012";
var ReactVersion = "18.3.0-canary-bb778528d-20231012";

// Might add PROFILE later.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8968,7 +8968,7 @@ var devToolsConfig$jscomp$inline_1008 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-ea8a8619c-20231012",
version: "18.3.0-canary-bb778528d-20231012",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1201 = {
Expand Down Expand Up @@ -8999,7 +8999,7 @@ var internals$jscomp$inline_1201 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-ea8a8619c-20231012"
reconcilerVersion: "18.3.0-canary-bb778528d-20231012"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1202 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9394,7 +9394,7 @@ var devToolsConfig$jscomp$inline_1050 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-ea8a8619c-20231012",
version: "18.3.0-canary-bb778528d-20231012",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1242 = {
Expand Down Expand Up @@ -9425,7 +9425,7 @@ var internals$jscomp$inline_1242 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-ea8a8619c-20231012"
reconcilerVersion: "18.3.0-canary-bb778528d-20231012"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1243 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (
}
"use strict";

var ReactVersion = "18.3.0-canary-ea8a8619c-20231012";
var ReactVersion = "18.3.0-canary-bb778528d-20231012";

// ATTENTION
// When adding new symbols to this file,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -580,4 +580,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-ea8a8619c-20231012";
exports.version = "18.3.0-canary-bb778528d-20231012";
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-ea8a8619c-20231012";
exports.version = "18.3.0-canary-bb778528d-20231012";

/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ea8a8619ce51a0f8f0a78f87485e4e2a6f9d8c27
bb778528d1ca22b44dad832f0258aaa4c0e6d4a4

0 comments on commit 191c16a

Please sign in to comment.