‘React’ must be in scope when using JSX react/react-in-jsx-scope?

  1. rules: {
  2. // suppress errors for missing 'import React' in files
  3. "react/react-in-jsx-scope": "off",
  4. // allow jsx syntax in js files (for next.js project)
  5. "react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }], //should add ".ts" if typescript project
  6. }