useTheme
Hook | Source Code
useTheme(): [Theme, Function]
Hooks onto the current theme avialable via the ThemeService. If no current theme is established (which can happen if the ThemeService hasn’t been started), the ThemeService.defaultTheme is used. Whenever the current theme is changed, this hook will automatically update.
Returns
Section titled “Returns”An array, where the first element is the current Theme, and the second element is a setter for the the current Theme. Using the setter triggers the ThemeService.onChangeTheme event, so all instances of this hook will be updated, as well as any listeners you may have registered to that event.