smolter
Guides

Errors and pending UI

Keep initial loading, route errors, and independent fetcher errors distinct.

Compatibility

ReactAvailable in this renderer's browser integration.
React SSRAvailable to this renderer's SSR integration; browser event handlers run after hydration.
PreactAvailable in this renderer's browser integration.
Preact SSRAvailable to this renderer's SSR integration; browser event handlers run after hydration.

Route modules

Re-export fallback and boundary components beside handlers. The error boundary gets an Error prop. Error messages are rendered when no boundary is provided.

export { loader } from "./loader";
export { action } from "./action";
export { HydrateFallback } from "./components/fallback";
export { ErrorBoundary } from "./components/error-boundary";
export { default } from "./view";

Successful undefined data

A loader can return undefined successfully. That still counts as loaded and should not remount the fallback during later revalidation. Use fetcher.state for button loading indicators.

Returned errors and Responses

Return an Error for failure or allow a rejected promise to be normalized. A Response carrying Location redirects internally. Other Response values are passed through; the client server transport expects JSON response bodies.