Skip to content

Commit

Permalink
feat(theming cleanup): update themedValue bool
Browse files Browse the repository at this point in the history
  • Loading branch information
Ddouglasz committed Apr 23, 2024
1 parent f00e0a1 commit c7e1be8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions design-system/src/theme-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -151,7 +150,7 @@ const useTheme = (parentSelector = defaultParentSelector): TUseThemeResult => {
}, []);

return {
theme: 'default',
theme,
themedValue,
isNewTheme: false,
isRecolouringTheme: true,
Expand Down

0 comments on commit c7e1be8

Please sign in to comment.