This article is a step-by-step guide on how to create a simple navigation bar using React.js, styled components for styling, and react router to ha...
For further actions, you may consider blocking this person and/or reporting abuse
Warning: React does not recognize the
activeStyle
prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercaseactivestyle
instead. If you accidentally passed it from a parent component, remove it from the DOM element.This issue is resolved.
Where?
I have updated the index.js code snippet. Feel free to check it out
Hi, where was the issue solved?
I have updated index.js code snippet. You can have a look at it
Thanks for the heads up.
ERROR in ./src/App.js 21:35-41
export 'Switch' (imported as 'Switch') was not found in 'react-router-dom' (possible exports: BrowserRouter, HashRouter, Link, MemoryRouter, NavLink, Navigate, NavigationType, Outlet, Route, Router, Routes, UNSAFE_LocationContext, UNSAFE_NavigationContext, UNSAFE_RouteContext, createPath, createRoutesFromChildren, createSearchParams, generatePath, matchPath, matchRoutes, parsePath, renderMatches, resolvePath, unstable_HistoryRouter, useHref, useInRouterContext, useLinkClickHandler, useLocation, useMatch, useNavigate, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRoutes, useSearchParams)
ERROR in ./src/components/Navbar/NavbarElements.js 5:0-39
Module not found: Error: Can't resolve 'styled-components' in 'C:\Users\MAX\header\src\components\Navbar'
webpack compiled with 2 errors
react-router-dom
updated their syntax. Use Routes instead of SwitchYou can find more information here.
github.com/howtographql/howtograph...
Compiled with problems:X
ERROR in ./src/components/Navbar/NavbarElements.js 5:0-39
Module not found: Error: Can't resolve 'styled-components' in 'C:\Users\MAX\nav\src\components\Navbar'
npm install styled-components --save
THIS FIXED IT
many thanks, would like to have some clearity conversation with you
hello there, I keep getting a blank page on my browser any help?
Just wanted to say nice tutorial. Definitely added it to my components.
Thank you
thanks for this post
Hi I follow the above instruction but still not responding in H tags why this happing ..
Issue has been fixed.
}/>
component instead of element
what do yuo mean by this
He is referring to to this line of code,
<Route path="/about" element={<About />} />
and the rest of theroute
The latest version of react router uses
element={<About />}
instead ofcomponent={<About />}
Thank you so much . It was easy to follow
Hey everything is working for me but for some reason my h1 tags are not showing? this happen to same tutorial i followed on w3school maybe you might have an idea why?
same here pages are not showing h1 tag or any other