Rules
no-namespace
Enforces the absence of a 'namespace' in React elements.
Full Name in eslint-plugin-react-dom
react-dom/no-namespaceFull Name in @eslint-react/eslint-plugin
@eslint-react/dom/no-namespacePresets
dom
recommended
recommended-typescript
recommended-type-checked
strict
strict-typescript
strict-type-checked
Rule Details
Namespaces, such as svg:circle, are not supported in React.
Common Violations
Invalid
function MyComponent() {
return (
<svg:circle
cx="50"
cy="50"
r="40"
stroke="black"
stroke-width="3"
fill="red"
/>
);
}Valid
function MyComponent() {
return <circle cx="50" cy="50" r="40" stroke="black" stroke-width="3" fill="red" />;
}