MAHESWAR DILEEP
MAHESWAR DILEEP

Reputation: 15

component is defined but never used no-unused-vars error warning in reactjs

enter image description here

import React from "react";
import navBar from "./components/navBar/navBar"; //navBar is imported here

function App() {
  return (
    <>
      <div className="App">
        <navBar /> //navBar is used here
      </div>
    </>
  );
}

export default App;

I changed the eslint. But no use and tried some stackoverflow solutions but no change.

Upvotes: 0

Views: 2109

Answers (1)

SounakP
SounakP

Reputation: 21

In JSX, lower-case tag names are considered to be HTML tags.

So you can change the component name to NavBar, or while importing you can write import NavBar from "./components/navBar/navBar"; //navBar is imported here

Upvotes: 2

Related Questions