Page
By default, you can create pages from the src/pages directory.
For example, to create a page named index, you can create a src/pages/index.tsx file and add the following content:
tsx
// src/pages/index.tsx
export function Component() {
return <div>Home Page</div>;
}Then, to create more pages, just create more files in the src/pages directory. For example, to create a page for the about route, you can create a src/pages/about.tsx file and add the following content:
tsx
// src/pages/about.tsx
export function Component() {
return <div>About Page</div>;
}TIP
- The page component must be exported as a
Componentfunction to be rendered as a page