mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
Ignore function and symbol values on custom-elements on the server (#21157)
This commit is contained in:
committed by
GitHub
parent
588db2e1fc
commit
a423a01223
@@ -71,7 +71,12 @@ export function createMarkupForCustomAttribute(
|
||||
name: string,
|
||||
value: mixed,
|
||||
): string {
|
||||
if (!isAttributeNameSafe(name) || value == null) {
|
||||
if (
|
||||
!isAttributeNameSafe(name) ||
|
||||
value == null ||
|
||||
typeof value === 'function' ||
|
||||
typeof value === 'symbol'
|
||||
) {
|
||||
return '';
|
||||
}
|
||||
return name + '=' + quoteAttributeValueForBrowser(value);
|
||||
|
||||
@@ -1070,7 +1070,11 @@ function pushStartCustomElement(
|
||||
// Ignored. These are built-in to React on the client.
|
||||
break;
|
||||
default:
|
||||
if (isAttributeNameSafe(propKey)) {
|
||||
if (
|
||||
isAttributeNameSafe(propKey) &&
|
||||
typeof propValue !== 'function' &&
|
||||
typeof propValue !== 'symbol'
|
||||
) {
|
||||
target.push(
|
||||
attributeSeparator,
|
||||
stringToChunk(propKey),
|
||||
|
||||
Reference in New Issue
Block a user