Harshith Tunuguntla
Harshith Tunuguntla

Reputation: 21

React says 'myComponent' is defined but never used, but still I am using <myComponent> in my code and react is not rendering anything on screen

Today I have created my basic react app where I have created a new component called 'myComponent.js' and later on I tried to import it into index file using import statement. When I use myComponent in the file to render it on screen and also a warning pops out saying 'myComponent' is defined but never used.

Upvotes: 2

Views: 153

Answers (1)

Lahcen
Lahcen

Reputation: 1423

The first letter should be capitalized. You should do updates to use <MyComponent/> instead

Upvotes: 1

Related Questions