Pages
Paths
File contain all routes
Copypages/constants.js
Contants.js
Copyexport const ROUTE_NOT_FOUND = '/not-found';export const ROUTE_SIGN_IN = '/sign-in';export const ROUTE_SIGN_UP = '/sign-up';export const ROUTE_PASSWORD_FORGOT = '/password/forgot';export const ROUTE_PASSWORD_RESET = '/password/reset';
Add new routes
Base routes in file:
Copypages/routes/Routes.jsx
Add new route and compontent to array:
Copyconst nonLoggedRoutes = [{ path: ROUTE_SIGN_IN, Component: SignIn },{ path: ROUTE_SIGN_UP, Component: SignUp },{ path: ROUTE_PASSWORD_FORGOT, Component: ForgotPassword },{ path: ROUTE_PASSWORD_RESET, Component: ResetPassword },];
Route Animations
Prop | Type | Required | Default |
---|---|---|---|
path | string | Required | |
children | node | Required | |
timeout | number | Optional | PAGE_TRANSITION_TIME |
animation | up | scale | down | none | Optional | up |
Code
Copy<AnimatedRoute key={path} path={path} animation={'up'}><Component /></AnimatedRoute>