Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/react-dom/src/server/ReactDOMServerFormatConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, ' +
Expand Down
6 changes: 4 additions & 2 deletions packages/react-dom/src/server/ReactPartialRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, ' +
Expand All @@ -1348,7 +1351,6 @@ class ReactDOMServerRenderer {

validateDangerousTag(tag);

let props = element.props;
if (tag === 'input') {
if (__DEV__) {
checkControlledValueProps('input', props);
Expand Down