Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed places of router config logic #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xiaoyunyang
Copy link

A few improvements

  1. renderRoutes does not need to be wrapped in <Switch /> because according to the source code, renderRoutes already wrap <Routes /> in <Switch />.
  2. Pushed <Header /> down a component level so <Header /> can receive route to know which component is currently selected. This is helpful for indicating an active status for the tab in the navbar that correspond to the selected page.
  3. Added .active styles to the css and created the logic in the <Header /> to underline the tab corresponding to the current page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant