Skip to main content
Version: Next

createReactExtension()

Home > @backstage/core-plugin-api > createReactExtension

Used by createComponentExtension() and createRoutableExtension().

Signature:

function createReactExtension<T extends (props: any) => JSX.Element | null>(options: {
component: ComponentLoader<T>;
data?: Record<string, unknown>;
name?: string;
}): Extension<T>;

Parameters

Parameter

Type

Description

options

{ component: ComponentLoader<T>; data?: Record<string, unknown>; name?: string; }

**Returns:**

Extension<T>

Remarks

We do not use ComponentType as the return type, since it doesn't let us convey the children prop. ComponentType inserts children as an optional prop whether the inner component accepts it or not, making it impossible to make the usage of children type safe.

See https://backstage.io/docs/plugins/composability#extensions.