Skip to main content

DefaultEntityPresentationApiRenderer.render

Home > @backstage/plugin-catalog > DefaultEntityPresentationApiRenderer > render

The actual render function.

Signature:

render: (options: {
entityRef: string;
loading: boolean;
entity: Entity | undefined;
context: {
defaultKind?: string;
defaultNamespace?: string;
};
}) => {
snapshot: Omit<EntityRefPresentationSnapshot, 'entityRef'>;
};

Remarks

This function may be called multiple times.

The loading flag signals that the framework MAY be trying to load more entity data from the catalog and call the render function again, if it succeeds. In some cases you may want to render a loading state in that case.

The entity may or may not be given. If the caller of the presentation API did present an entity upfront, then that's what will be passed in here. Otherwise, it may be a server-side entity that either comes from a local cache or directly from the server.

In either case, the renderer should return a presentation that is the most useful possible for the end user, given the data that is available.