Closed shivamsouravjha closed 3 years ago
You need to capitalize the component name "MainNavigation" and it's export
Any Specific reason? I thought it's a way of writing not some mandatory way.
Any Specific reason? I thought it's a way of writing not some mandatory way.
It's mandatory for your own components as the code gets passed to React.createElement() before render.
React will treat lowercase component names as jsx and so try and render it as if it was an HTML element such as a div or p tag. Just changing it to starting with a capital letter tells react this is a react component and so it will allow you to access reacts own lifecycle methods inside.
yup, that the case, but had to edit the header as well. thanks!
./src/shared/Components/Navigation/mainnavigation.js Line 10:44: React Hook "useState" is called in function "mainnavigation" which is neither a React function component or a custom React Hook function react-hooks/rules-of-hooks
Search for the keywords to learn more about each error.
after NPM install,this error appears, this was used in sidedrawer to make navigation bar in phone appear upon click.