Pattern: Missing React
import with JSX usage
Issue: -
JSX syntax transpiles to React.createElement()
calls, requiring the React
variable to be in scope. Without importing React, JSX code will fail at runtime.
Example of incorrect code:
var a = <a />;
Example of correct code:
import React from "react";
var a = <a />;