Advanced Usage
React Router
Advanced prerendering, loader, and deployment guidance for React Router applications using Paragraph CMS.
React Router's advanced integration work centers on choosing the right mix of prerendered paths, runtime loaders, and SPA fallback behavior for CMS-backed routes.
Rendering strategy
- prerender routes whose paths can be derived from CMS data ahead of time;
- keep loader logic reusable between prerendered and runtime-rendered routes;
- decide explicitly whether deployment keeps
ssr: truefor hybrid rendering orssr: falsefor static hosting; and - ensure parent loader data still resolves correctly for child routes that are not prerendered.
Preview and publishing
- keep draft preview on a runtime server even if most published routes are static;
- generate prerender path lists from CMS slugs rather than hard-coding them;
- rebuild or refresh prerendered
.htmland.dataoutput after publish; and - keep redirect and not-found behavior consistent between prerendered and runtime routes.
Remix note
If you previously organized this stack as Remix, the current framework path is React Router. The concepts are still close, but new implementation guidance should target React Router configuration and prerender APIs.