mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Don't warn for casing if it's a custom element (#21156)
This replicates what we do on the client.
This commit is contained in:
@@ -1211,7 +1211,11 @@ export function pushStartInstance(
|
||||
formatContext.insertionMode !== SVG_MODE &&
|
||||
formatContext.insertionMode !== MATHML_MODE
|
||||
) {
|
||||
if (type.toLowerCase() !== type) {
|
||||
if (
|
||||
type.indexOf('-') === -1 &&
|
||||
typeof props.is !== 'string' &&
|
||||
type.toLowerCase() !== type
|
||||
) {
|
||||
console.error(
|
||||
'<%s /> is using incorrect casing. ' +
|
||||
'Use PascalCase for React components, ' +
|
||||
|
||||
+4
-2
@@ -1331,11 +1331,14 @@ class ReactDOMServerRenderer {
|
||||
namespace = getIntrinsicNamespace(tag);
|
||||
}
|
||||
|
||||
let props = element.props;
|
||||
|
||||
if (__DEV__) {
|
||||
if (namespace === HTML_NAMESPACE) {
|
||||
const isCustomComponent = isCustomComponentFn(tag, props);
|
||||
// Should this check be gated by parent namespace? Not sure we want to
|
||||
// allow <SVG> or <mATH>.
|
||||
if (tag.toLowerCase() !== element.type) {
|
||||
if (!isCustomComponent && tag.toLowerCase() !== element.type) {
|
||||
console.error(
|
||||
'<%s /> is using incorrect casing. ' +
|
||||
'Use PascalCase for React components, ' +
|
||||
@@ -1348,7 +1351,6 @@ class ReactDOMServerRenderer {
|
||||
|
||||
validateDangerousTag(tag);
|
||||
|
||||
let props = element.props;
|
||||
if (tag === 'input') {
|
||||
if (__DEV__) {
|
||||
checkControlledValueProps('input', props);
|
||||
|
||||
Reference in New Issue
Block a user