Skip to main content

Module: shared/components/routes

Component

AnonymousRoute

AnonymousRoute(): Element

Renders route only for anonymous users

Returns

Element

Example

Example route configuration using AnonymousRoute component:

<Route path="/" element={<AnonymousRoute />}>
<Route index element={<span>Page accessible only anonymous users</span>} />
</Route>

Defined in

packages/webapp/src/shared/components/routes/anonymousRoute/anonymousRoute.component.tsx:21


AuthRoute

AuthRoute(allowedRoles): Element

Renders route only for authenticated users

Parameters

NameType
allowedRolesAuthRouteProps

Returns

Element

Example

Example route configuration using AuthRoute component:

<Route path="/" element={<AuthRoute allowedRoles={Role.ADMIN} />}>
<Route index element={<span>Page accessible only by admins</span>} />
</Route>

Defined in

packages/webapp/src/shared/components/routes/authRoute/authRoute.component.tsx:28