Please I need help.
I've bought React Keentheme and I don't understand how can I switch or set theme mode from react component?
code example: style.scss
// Mode
$mode: default; or $mode: light; or $mode: light;
@function getMode() {
@if (variable-exists(mode)) {
@return $mode;
} @else {
@return default;
}
}
Thanks
Hi,
Thank you for reaching out to us.
You can change theme mode programmatically by using the updateMode function of ThemeModeProvider.
Here is an example:
const { updateMode } = useThemeMode();
updateMode("light");