DocumentationRulesdom/no-namespace

no-namespace

Rule category

Correctness.

What it does

Enforces the absence of a namespace in React elements.

Why is this bad?

Namespaces, such as with svg:circle are not supported in React.

Examples

Failing

import React from "react";
 
function Example() {
  return (
    <svg:circle
      cx="50"
      cy="50"
      r="40"
      stroke="black"
      stroke-width="3"
      fill="red"
    />
  );
}

Passing

import React from "react";
 
function Example() {
  return (
    <circle cx="50" cy="50" r="40" stroke="black" stroke-width="3" fill="red" />
  );
}