useTheme
Home > @gooddata/sdk-ui-theme-provider > useTheme
useTheme variable
Hook for reaching the theme from context.
Signature:
useTheme: (theme?: ITheme) => ITheme | undefined
Remarks
You can optionally set a theme override that will be returned if defined. This makes the usage more ergonomic (see the following example).
Example
// instead of
const fromContext = useTheme();
const effectiveTheme = fromArguments ?? fromContext.
// you can write
const theme = useTheme(fromArguments);