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

Viewed 61

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.

1 Answers

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

Related