From a7b95eb0b0ce8cf6e04937fcad54a53681f7188a Mon Sep 17 00:00:00 2001 From: Martin Marosi Date: Tue, 24 Sep 2024 13:40:37 +0200 Subject: [PATCH] fix(react): memoize provider value --- packages/react-core/src/scalprum-provider.tsx | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/packages/react-core/src/scalprum-provider.tsx b/packages/react-core/src/scalprum-provider.tsx index dbac19d..0d9d8a9 100644 --- a/packages/react-core/src/scalprum-provider.tsx +++ b/packages/react-core/src/scalprum-provider.tsx @@ -72,15 +72,20 @@ export function ScalprumProvider = Record ({ + config: state.appsConfig, + api: state.api, + initialized: true, + pluginStore: state.pluginStore, + }), + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + [props.api, props.config, props.scalprum, state], + ); + return ( - + {props.children} );