From 91cbaedef0cf03e514cc5089d48f1ac3f4d61db2 Mon Sep 17 00:00:00 2001 From: Ester Marti Date: Tue, 24 Aug 2021 10:41:39 +0200 Subject: [PATCH] Add type for state --- .../public/application/global_state_context.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/monitoring/public/application/global_state_context.tsx b/x-pack/plugins/monitoring/public/application/global_state_context.tsx index 2581d4232489f..f587d7b1045ad 100644 --- a/x-pack/plugins/monitoring/public/application/global_state_context.tsx +++ b/x-pack/plugins/monitoring/public/application/global_state_context.tsx @@ -8,14 +8,18 @@ import React, { createContext } from 'react'; import { GlobalState } from '../url_state'; import { MonitoringStartPluginDependencies } from '../types'; -export const GlobalStateContext = createContext({}); - interface GlobalStateProviderProps { query: MonitoringStartPluginDependencies['data']['query']; toasts: MonitoringStartPluginDependencies['core']['notifications']['toasts']; children: React.ReactNode; } +interface State { + cluster_uuid?: string; +} + +export const GlobalStateContext = createContext({} as State); + export const GlobalStateProvider = ({ query, toasts, children }: GlobalStateProviderProps) => { const fakeRootScope: Partial = { $on: (