DEV Community

nbvora
nbvora

Posted on

How to make protected Component(not routes) in reactjs

I have requirement for e-commerece portal. On home page all the components works without authentication but once I logged in then in topbar I have some authenticated components.

Same there are many other components which is available once you login. So I am looking for mechanism where we can do Protected component rendering mechanism like ProtectedRoute. If anyone has idea then do let me know.

Thank you

Top comments (0)