react/no-namespace
Disallow namespaced element names such as <svg:circle>
JSX syntax allows a name with a colon in it, such as <svg:circle>, but React doesn't support namespaced elements. The same goes for a name with a colon passed to React.createElement.
Configure#
Off by default. To turn it on:
bunfig.toml
[lint.rules]
"react/no-namespace" = "error" # or "warn"Examples#
example.jsx2 problems
const dot = <svg:circle r="4" />React component svg:circle must not be in a namespace, as React does not support them;
const line = React.createElement("svg:line")React component svg:line must not be in a namespace, as React does not support them;example.jsxNo problems
const dot = <circle r="4" />;
const line = React.createElement("line");