Skip to content

Commit

Permalink
Merge pull request #1635 from gluestack/release/@gluestack-style/reac…
Browse files Browse the repository at this point in the history
  • Loading branch information
ankit-tailor authored Jan 15, 2024
2 parents e743b34 + 8cb7692 commit 360840e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
7 changes: 7 additions & 0 deletions packages/styled/react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @gluestack-style/react

## 1.0.39

### Patch Changes

- - Fixed useToken hook with theme support [PR](https://github.com/gluestack/gluestack-ui/pull/1634)
- Fixed resolved props tokenization for mobile [PR](https://github.com/gluestack/gluestack-ui/pull/1632)

## 1.0.38

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/styled/react/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@gluestack-style/react",
"description": "A universal & performant styling library for React Native, Next.js & React",
"version": "1.0.38",
"version": "1.0.39",
"keywords": [
"React Native",
"Next.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/styled/react/src/hooks/useToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const useToken = <T extends keyof Tokens>(

for (const key in activeThemes?.reverse()) {
const currentTheme = activeThemes[key];
if (theme.config.themes.hasOwnProperty(currentTheme)) {
if (theme?.config?.themes?.hasOwnProperty(currentTheme)) {
const currentThemeTokens = theme?.config?.themes[currentTheme];

if (currentThemeTokens?.[tokenScale]?.[token]) {
Expand Down
8 changes: 6 additions & 2 deletions packages/styled/react/src/styled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,7 @@ function resolveInlineProps(
CONFIG: any
) {
let resolvedInlineProps = {};

if (
componentStyleConfig.resolveProps &&
Object.keys(componentExtendedConfig).length > 0
Expand All @@ -760,9 +761,11 @@ function resolveInlineProps(
CONFIG,
CONFIG.propertyTokenMap,
toBeResovledProp,
scale
scale,
Platform.OS !== 'web'
)
);

//@ts-ignore
resolvedInlineProps[toBeResovledProp] = token;
} else {
Expand All @@ -772,7 +775,8 @@ function resolveInlineProps(
componentExtendedConfig,
props,
toBeResovledProp,
props[toBeResovledProp]
props[toBeResovledProp],
Platform.OS !== 'web'
);
}
delete props[toBeResovledProp];
Expand Down

0 comments on commit 360840e

Please sign in to comment.