You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/react-dom-bindings/src/server/ReactFizzConfigDOM.js
+7-6
Original file line number
Diff line number
Diff line change
@@ -2960,7 +2960,7 @@ function pushTitle(
2960
2960
2961
2961
if(Array.isArray(children)&&children.length>1){
2962
2962
console.error(
2963
-
'React expects the `children` prop of <title> tags to be a string, number, or object with a novel `toString` method but found an Array with length %s instead.'+
2963
+
'React expects the `children` prop of <title> tags to be a string, number, bigint, or object with a novel `toString` method but found an Array with length %s instead.'+
2964
2964
' Browsers treat all child Nodes of <title> tags as Text content and React expects to be able to convert `children` of <title> tags to a single string value'+
2965
2965
' which is why Arrays of length greater than 1 are not supported. When using JSX it can be commong to combine text nodes and value nodes.'+
2966
2966
' For example: <title>hello {nameOfUser}</title>. While not immediately apparent, `children` in this case is an Array with length 2. If your `children` prop'+
@@ -2971,22 +2971,22 @@ function pushTitle(
2971
2971
constchildType=
2972
2972
typeofchild==='function' ? 'a Function' : 'a Sybmol';
2973
2973
console.error(
2974
-
'React expect children of <title> tags to be a string, number, or object with a novel `toString` method but found %s instead.'+
2974
+
'React expect children of <title> tags to be a string, number, bigint, or object with a novel `toString` method but found %s instead.'+
2975
2975
' Browsers treat all child Nodes of <title> tags as Text content and React expects to be able to convert children of <title>'+
2976
2976
' tags to a single string value.',
2977
2977
childType,
2978
2978
);
2979
2979
}elseif(child&&child.toString==={}.toString){
2980
2980
if(child.$$typeof!=null){
2981
2981
console.error(
2982
-
'React expects the `children` prop of <title> tags to be a string, number, or object with a novel `toString` method but found an object that appears to be'+
2982
+
'React expects the `children` prop of <title> tags to be a string, number, bigint, or object with a novel `toString` method but found an object that appears to be'+
2983
2983
' a React element which never implements a suitable `toString` method. Browsers treat all child Nodes of <title> tags as Text content and React expects to'+
2984
2984
' be able to convert children of <title> tags to a single string value which is why rendering React elements is not supported. If the `children` of <title> is'+
2985
2985
' a React Component try moving the <title> tag into that component. If the `children` of <title> is some HTML markup change it to be Text only to be valid HTML.',
2986
2986
);
2987
2987
}else{
2988
2988
console.error(
2989
-
'React expects the `children` prop of <title> tags to be a string, number, or object with a novel `toString` method but found an object that does not implement'+
2989
+
'React expects the `children` prop of <title> tags to be a string, number, bigint, or object with a novel `toString` method but found an object that does not implement'+
2990
2990
' a suitable `toString` method. Browsers treat all child Nodes of <title> tags as Text content and React expects to be able to convert children of <title> tags'+
2991
2991
' to a single string value. Using the default `toString` method available on every object is almost certainly an error. Consider whether the `children` of this <title>'+
2992
2992
' is an object in error and change it to a string or number value if so. Otherwise implement a `toString` method that React can use to produce a valid <title>.',
@@ -3123,10 +3123,11 @@ function pushStartTitle(
3123
3123
}elseif(
3124
3124
childForValidation!=null&&
3125
3125
typeofchildForValidation!=='string'&&
3126
-
typeofchildForValidation!=='number'
3126
+
typeofchildForValidation!=='number'&&
3127
+
typeofchildForValidation!=='bigint'
3127
3128
){
3128
3129
console.error(
3129
-
'A title element received a value that was not a string or number for children. '+
3130
+
'A title element received a value that was not a string or number or bigint for children. '+
3130
3131
'In the browser title Elements can only have Text Nodes as children. If '+
3131
3132
'the children being rendered output more than a single text node in aggregate the browser '+
3132
3133
'will display markup and comments as text in the title and hydration will likely fail and '+
0 commit comments