StefanaB
StefanaB

Reputation: 183

Accessing react components directly from URL

I am trying to create an new react app. I have 3 components: app (with login functionality) , admin and client.

Thank you !

Upvotes: 1

Views: 530

Answers (2)

Samuel Nihoul
Samuel Nihoul

Reputation: 58

To bypass the login, you may want to make a 'test-admin' route and a private 'admin' route. Here is how to make a private route if you happen to need it:

https://dev.to/karanpratapsingh/private-public-and-restricted-routes-in-react-42ff

Upvotes: 1

TheTisiboth
TheTisiboth

Reputation: 1651

You can use react-router, that allow to define some route based on URL. When you have a login feature, then you would probably wants to have some protected route, that are only accessible when you are logged in. Then I recommend you to read this article

Upvotes: 1

Related Questions