Skip to content

Commit

Permalink
fix: fix tokens types in dash context
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredLunde committed Oct 9, 2021
1 parent ca5f86b commit 729b249
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,12 @@ export function createStyles<

const DashContext = React.createContext<{
styles: typeof styles;
tokens: VT[keyof VT];
tokens: ValueOf<Omit<VT, "default">>;
theme: keyof VT;
setTheme(theme: typeof currentTheme): void;
}>({
styles,
tokens: tokens[currentTheme],
tokens: tokens[currentTheme] as VT[Exclude<keyof VT, "default">],
theme: currentTheme,
setTheme(theme) {
/* istanbul ignore next */
Expand Down Expand Up @@ -395,7 +395,7 @@ export function createStyles<
value={React.useMemo(
() => ({
styles,
tokens: tokens[theme],
tokens: tokens[theme] as ValueOf<Omit<VT, "default">>,
theme,
setTheme(nextTheme) {
if (nextTheme !== theme) storedOnChange.current?.(nextTheme);
Expand Down

0 comments on commit 729b249

Please sign in to comment.