Home > @plasmicapp/loader-react > PlasmicComponentLoader > fetchComponentData

PlasmicComponentLoader.fetchComponentData() method

Pre-fetches component data needed to for PlasmicLoader to render these components. Should be passed into PlasmicRootProvider as the prefetchedData prop.

You can look up a component either by: - the name of the component - the path for a page component - an array of strings that make up parts of the path - object { name: "name_or_path", projectId: ...}, to specify which project to use, if multiple projects have the same component name

Throws an Error if a specified component to fetch does not exist in the Plasmic project.

Signature:

fetchComponentData(...specs: ComponentLookupSpec[]): Promise<ComponentRenderData>;

Parameters

Parameter Type Description
specs ComponentLookupSpec[]

Returns:

Promise<ComponentRenderData>