Skip to content

Commit

Permalink
Merge pull request #8455 from marmelab/gh8426
Browse files Browse the repository at this point in the history
Fix ToggleThemeButton behaviour
  • Loading branch information
djhi authored Dec 1, 2022
2 parents 59e8b80 + 9ff91ef commit a9b4239
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/button/ToggleThemeButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { RaThemeOptions } from '..';
export const ToggleThemeButton = (props: ToggleThemeButtonProps) => {
const translate = useTranslate();
const { darkTheme, lightTheme } = props;
const [theme, setTheme] = useTheme(lightTheme);
const [theme, setTheme] = useTheme();

const handleTogglePaletteType = (): void => {
setTheme(theme?.palette.mode === 'dark' ? lightTheme : darkTheme);
Expand Down

0 comments on commit a9b4239

Please sign in to comment.