Rules
jsx-no-undef
Full Name in eslint-plugin-react-x
react-x/jsx-no-undef
Full Name in @eslint-react/eslint-plugin
@eslint-react/jsx-no-undef
Description
Prevents using variables in JSX that are not defined in the scope.
Examples
Failing
import React from "react";
const button = <MyButton />;
// ^^^^^^^^
// - 'MyButton' is not defined
Passing
import React from "react";
import MyButton from "./MyButton";
const button = <MyButton />;
Implementation
See Also
jsx-uses-vars
Marks variables used in JSX elements as used.jsx-uses-react
Marks React variables as used when JSX is used.jsx-no-duplicated-props
Disallow duplicate props in JSX elements.