Rules
no-namespace
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
Description
Enforces the absence of a namespace in React elements.
Namespaces, such as with svg:circle are not supported in React.
Examples
Failing
import React from "react";
function MyComponent() {
  return (
    <svg:circle
      cx="50"
      cy="50"
      r="40"
      stroke="black"
      stroke-width="3"
      fill="red"
    />
  );
}Passing
import React from "react";
function MyComponent() {
  return <circle cx="50" cy="50" r="40" stroke="black" stroke-width="3" fill="red" />;
}