You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apologies if this has been highlighted elsewhere, but I'm wondering how I should approach a NavBar component for selecting routes. In ReactRouter or TanStack router, I'd do something like this in App.tsx
Where this component acts as a site template, and the content gets injected into <Outlet /> when a route changes. I understand that wouter's approach is different. So, I might have a <NavBar /> that looks like this:
The issue here is: There's a circular dependency between NavBar and Users. I'm wondering what the correct approach is here. Should I be leveraging the <Router /> component in this case? Are people creating a NavBar per page? Thanks in advance!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Apologies if this has been highlighted elsewhere, but I'm wondering how I should approach a
NavBarcomponent for selecting routes. In ReactRouter or TanStack router, I'd do something like this inApp.tsxWhere this component acts as a site template, and the content gets injected into
<Outlet />when a route changes. I understand that wouter's approach is different. So, I might have a<NavBar />that looks like this:And I would need to re-construct the template per page. Using
<Users />as an example:The issue here is: There's a circular dependency between
NavBarandUsers. I'm wondering what the correct approach is here. Should I be leveraging the<Router />component in this case? Are people creating aNavBarper page? Thanks in advance!Beta Was this translation helpful? Give feedback.
All reactions