Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

Commit

Permalink
Merge pull request #491 from gluestack/fix/use-token-default-value
Browse files Browse the repository at this point in the history
fix: return default value as fallback
  • Loading branch information
ankit-tailor authored Oct 19, 2023
2 parents 1245311 + 00535fe commit 0a297d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react/src/hooks/useToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ export const useToken = (tokenScale: string, token: string) => {
const theme: ICustomConfig = useStyled();
// @ts-ignore
const themeTokens = theme.config.tokens;
return themeTokens?.[`${tokenScale}`]?.[`${token}`];
return themeTokens?.[`${tokenScale}`]?.[`${token}`] ?? token;
};

0 comments on commit 0a297d8

Please sign in to comment.