Skip to main content

Creating themes

ThemeContext

NameTypeArgumentsDescription
makeClassesTMakeClasses<T extends TTheme>см. makeClassesEverything is the same as with the usual makeClasses, but in props you can access the `theme'.
useThemeIStore<T>['useSubscribe']1 - listener ((state: TTheme) => state)Allows you to subscribe to the entire active topic or only to a certain part.
switchTheme(themeName: K extends string) => void1 - themeNameAllows you to switch the active theme.
reset() => void-Resets the state by the time of initialization. Namely, the object with the themes will remain in memory. But the selected topic will be reset to default and the listeners will be cleared.