1

when i am run npm start in termianl then i am facing this type of error so I have no idea what I do...?

import logo from './logo.svg';
import './App.css';

function App() {
  return (
    <div className="App">
      <header className="App-header">
        <img src={logo} className="App-logo" alt="logo" />
        <p>
          Edit <code>src/App.js</code> and save to reload.
        </p>
        <a
          className="App-link"
          href="https://reactjs.org"
          target="_blank"
          rel="noopener noreferrer"
        >
          Learn React
        </a>
      </header>
    </div>
  );
}

export default App;
Nick Parsons
  • 45,728
  • 6
  • 46
  • 64
Yadav Akash
  • 81
  • 1
  • 6

1 Answers1

1

As noted by Dave, it is not necessary to import React anymore for JSX to work, so this ESLint rule is probably throwing the error, depending on your ESLint configuration. You can either disable the rule on your configuration file or the ignore file or import React.

import React from 'react';
rd05
  • 64
  • 4
  • 1
    (Noting that this is version-specific and is no longer required https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html) – Dave Newton Jul 23 '21 at 11:56
  • Thanks for noting this. However, depending on the ESLint configuration for their project, there is still the rule requiring this. – rd05 Jul 23 '21 at 11:58