mirror of
https://github.com/grafana/grafana.git
synced 2024-12-02 13:39:19 -06:00
ThemeContext: Fix useStyles return type (#26696)
Still returned `any` because the type of memoizedStyleCreator wasn't declared properly.
This commit is contained in:
parent
ba2524cd88
commit
ed950842bd
@ -51,7 +51,7 @@ export function useTheme(): GrafanaTheme {
|
||||
export function useStyles<T>(getStyles: (theme: GrafanaTheme) => T) {
|
||||
const theme = useTheme();
|
||||
|
||||
let memoizedStyleCreator = memoizedStyleCreators.get(getStyles);
|
||||
let memoizedStyleCreator = memoizedStyleCreators.get(getStyles) as typeof getStyles;
|
||||
if (!memoizedStyleCreator) {
|
||||
memoizedStyleCreator = stylesFactory(getStyles);
|
||||
memoizedStyleCreators.set(getStyles, memoizedStyleCreator);
|
||||
|
Loading…
Reference in New Issue
Block a user