Commit bb77852
authored
[Fizz] Fix children rendering in custom elements with
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: #27286enableCustomElementPropertySupport (#27511)1 parent ea8a861 commit bb77852
File tree
2 files changed
+45
-22
lines changed- packages
- react-dom-bindings/src/server
- react-dom/src/__tests__
2 files changed
+45
-22
lines changedLines changed: 19 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3134 | 3134 | | |
3135 | 3135 | | |
3136 | 3136 | | |
3137 | | - | |
| 3137 | + | |
3138 | 3138 | | |
3139 | 3139 | | |
3140 | 3140 | | |
3141 | 3141 | | |
3142 | 3142 | | |
3143 | | - | |
3144 | | - | |
3145 | | - | |
3146 | | - | |
3147 | | - | |
3148 | | - | |
3149 | | - | |
3150 | | - | |
3151 | | - | |
3152 | | - | |
3153 | | - | |
3154 | | - | |
3155 | | - | |
3156 | | - | |
3157 | | - | |
3158 | | - | |
3159 | | - | |
3160 | | - | |
3161 | | - | |
3162 | | - | |
| 3143 | + | |
3163 | 3144 | | |
3164 | 3145 | | |
3165 | 3146 | | |
| |||
3174 | 3155 | | |
3175 | 3156 | | |
3176 | 3157 | | |
| 3158 | + | |
| 3159 | + | |
| 3160 | + | |
| 3161 | + | |
| 3162 | + | |
| 3163 | + | |
| 3164 | + | |
3177 | 3165 | | |
3178 | 3166 | | |
3179 | 3167 | | |
3180 | 3168 | | |
3181 | 3169 | | |
3182 | 3170 | | |
| 3171 | + | |
| 3172 | + | |
| 3173 | + | |
| 3174 | + | |
| 3175 | + | |
| 3176 | + | |
| 3177 | + | |
| 3178 | + | |
| 3179 | + | |
3183 | 3180 | | |
3184 | 3181 | | |
3185 | | - | |
| 3182 | + | |
3186 | 3183 | | |
3187 | 3184 | | |
3188 | 3185 | | |
| |||
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3624 | 3624 | | |
3625 | 3625 | | |
3626 | 3626 | | |
| 3627 | + | |
| 3628 | + | |
| 3629 | + | |
| 3630 | + | |
| 3631 | + | |
| 3632 | + | |
| 3633 | + | |
| 3634 | + | |
| 3635 | + | |
| 3636 | + | |
| 3637 | + | |
| 3638 | + | |
| 3639 | + | |
| 3640 | + | |
| 3641 | + | |
| 3642 | + | |
| 3643 | + | |
| 3644 | + | |
| 3645 | + | |
| 3646 | + | |
| 3647 | + | |
| 3648 | + | |
| 3649 | + | |
| 3650 | + | |
| 3651 | + | |
| 3652 | + | |
3627 | 3653 | | |
3628 | 3654 | | |
3629 | 3655 | | |
| |||
0 commit comments