Pattern: Undeclared variable in JSX
Issue: -
Using undefined variables in JSX likely indicates a misspelling or a missing import, which will cause a ReferenceError
at runtime. All components used in JSX must be declared or imported before use.
Example of incorrect code:
const C = <B />; // B is not defined
Example of correct code:
import B from './B';
const C = <B />;