Home > Enterprise >  Display Differett navigation bars in differet pages in reactjs
Display Differett navigation bars in differet pages in reactjs

Time:11-06

I want to display different header for different pages in reactjs. I have tried props method but that was not up to the mark, anybody anyidea how to do with other method ?

Tried using props but solutiin getting big

CodePudding user response:

You can try using react-router-dom. This might help you achieve the task. and please elaborate on the problem bit more.

CodePudding user response:

you can use react-router-dom and make a layout component . in layout you should use "useParams" hook of react-router-dom package and then Conditional page based on url to show your intended layout for each url.

  • Related