Skip to main content

withApis()

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

Wrapper for giving component an API context.

Signature:

function withApis<T extends {}>(apis: TypesToApiRefs<T>): <TProps extends T>(WrappedComponent: React.ComponentType<TProps>) => {
(props: React.PropsWithChildren<Omit<TProps, keyof T>>): React.JSX.Element;
displayName: string;
};

Parameters

ParameterTypeDescription
apisTypesToApiRefs<T>APIs for the context.

Returns:

<TProps extends T>(WrappedComponent: React.ComponentType<TProps>) => { (props: React.PropsWithChildren<Omit<TProps, keyof T>>): React.JSX.Element; displayName: string; }