diff --git a/design-system/src/theme-provider.tsx b/design-system/src/theme-provider.tsx index e03eccd46d..cf96ba5e7c 100644 --- a/design-system/src/theme-provider.tsx +++ b/design-system/src/theme-provider.tsx @@ -133,9 +133,8 @@ const useTheme = (parentSelector = defaultParentSelector): TUseThemeResult => { // TODO - make sure old and new theme return same value as new defaultThemeValue // At least for the remaining places that we still use this function const themedValue: TUseThemeResult['themedValue'] = useCallback( - (defaultThemeValue, _newThemeValue) => - theme === 'default' ? defaultThemeValue : defaultThemeValue, - [theme] + (defaultThemeValue, _newThemeValue) => defaultThemeValue, + [] ); // If we use 'useLayoutEffect' here, we would be trying to read the @@ -151,7 +150,7 @@ const useTheme = (parentSelector = defaultParentSelector): TUseThemeResult => { }, []); return { - theme: 'default', + theme, themedValue, isNewTheme: false, isRecolouringTheme: true,