The View component houses global components common to all views, such as notifications and dialogs. It handles errors, sets the document title, and renders the specified layout. The view and its props are rendered by the router.
Info
Props are passed to this component automatically from the router.
Usage
import { View } from 'components/lib';
import { Dashboard } from 'views/dashboard/dashboard';
function MyApp() {
return (
<View
title="Dashboard"
layout="app"
view={ Dashboard }
/>
);
}
Props
| Prop | Description | Required | Value |
|---|---|---|---|
| view | view component | required | component |
| layout | layout (defaults to app) | optional | string (account/app/auth/onboarding) |
| title | document title | required | string |
Notes
- The
Viewcomponent relies onViewContextfor managing notifications, dialogs, and error handling. - The component uses
useTranslationfor internationalization anduseToastfor toast notifications. - Layouts include
AppLayout,AuthLayout,AccountLayout, andOnboardingLayout.