Plugin Extensions: Add context prop to PluginExtensionComponentConfig.component (#75019)

* Add context prop to PluginExtensionComponentConfig.component

* Make context prop optional
This commit is contained in:
Jaroslav Benc
2023-09-19 09:53:54 +02:00
committed by GitHub
parent e387923899
commit 8b4d167de5

View File

@@ -84,7 +84,9 @@ export type PluginExtensionComponentConfig<Context extends object = object> = {
// The React component that will be rendered as the extension
// (This component receives the context as a prop when it is rendered. You can just return `null` from the component to hide for certain contexts)
component: React.ComponentType;
component: React.ComponentType<{
context?: Context;
}>;
// The unique identifier of the Extension Point
// (Core Grafana extension point ids are available in the `PluginExtensionPoints` enum)