From 8b4d167de5fde9067297850c8d70dabb82cead2a Mon Sep 17 00:00:00 2001 From: Jaroslav Benc Date: Tue, 19 Sep 2023 09:53:54 +0200 Subject: [PATCH] Plugin Extensions: Add context prop to PluginExtensionComponentConfig.component (#75019) * Add context prop to PluginExtensionComponentConfig.component * Make context prop optional --- packages/grafana-data/src/types/pluginExtensions.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/grafana-data/src/types/pluginExtensions.ts b/packages/grafana-data/src/types/pluginExtensions.ts index 7bed037bb9a..568ad10d3dc 100644 --- a/packages/grafana-data/src/types/pluginExtensions.ts +++ b/packages/grafana-data/src/types/pluginExtensions.ts @@ -84,7 +84,9 @@ export type PluginExtensionComponentConfig = { // 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)