From 7925bdf1098fd67fdd5fcbf4c2283a269a8a8d1c Mon Sep 17 00:00:00 2001 From: bnechyporenko Date: Wed, 6 Jul 2022 14:22:56 +0200 Subject: [PATCH] Incorporated the feedback. Signed-off-by: bnechyporenko --- .../src/plugin-options/usePluginOptions.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/core-plugin-api/src/plugin-options/usePluginOptions.tsx b/packages/core-plugin-api/src/plugin-options/usePluginOptions.tsx index 3970c8c133..499c4f10d3 100644 --- a/packages/core-plugin-api/src/plugin-options/usePluginOptions.tsx +++ b/packages/core-plugin-api/src/plugin-options/usePluginOptions.tsx @@ -38,13 +38,15 @@ export const PluginProvider = ({ children, plugin, }: PluginOptionsProviderProps): JSX.Element => { - const providerPlugin = plugin as unknown as { - getPluginOptions(): PluginOptions; - }; - const value = { pluginOptions: providerPlugin.getPluginOptions() }; const { Provider } = createVersionedContext<{ 1: PluginOptions }>(contextKey); return ( - + {children} ); @@ -72,5 +74,5 @@ export function usePluginOptions< throw new Error('Plugin Options v1 is not available'); } - return value.pluginOptions as TPluginOptions; + return value.options as TPluginOptions; }