Skip to main content

default export

The React component that renders when the route matches.

Signature

The default export is a React component with no props. It must be present in every route module.

Basic Example

Using Loader Data

Nested Routes with Outlet

With Actions and Forms

Async Components

Components cannot be async. Use loaders for data fetching:

Component Naming

You can use any valid function name:

Best Practices

Structure your components with proper HTML elements:
Extract complex UI into separate components:
Use hooks to handle different states:
Leverage type inference from loaders and actions:

See Also