loadRouteData
Describes@ebitex/content-sdk 1.xSee the changelog:@ebitex/content-sdk
loadRouteData(
definitions,route,options?):Promise<LoadedRouteData>
Loads the data a route needs, without React: for a server that resolved the page, to answer a
real 404 before rendering and to hand the values to <Experience initialRouteData> so the
browser does not load them again.
const result = await client.resolveLocation(url)const data = result.kind === 'presentation' ? await loadRouteData([personData], result.route, { locale: result.locale }) : undefinedif (data?.notFound) return new Response('Not found', { status: 404 })Only definitions whose tag matches the route’s run; with no route (an ordinary page) nothing runs. A definition for another address is skipped, never an error, in either mode. A loader’s own errors reject this promise.
Parameters
Section titled “Parameters”definitions
Section titled “definitions”readonly AnyRouteDataDefinition[]
RouteResult | undefined
options?
Section titled “options?”locale?
Section titled “locale?”string
signal?
Section titled “signal?”AbortSignal
Returns
Section titled “Returns”Promise<LoadedRouteData>