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 #535 from gluestack/release/@gluestack-style/react…
Browse files Browse the repository at this point in the history
…@1.0.16

Release/@gluestack style/[email protected]
  • Loading branch information
surajahmed authored Nov 16, 2023
2 parents 9207576 + 1c142df commit 58a2219
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 11 deletions.
7 changes: 7 additions & 0 deletions packages/react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @gluestack-style/react

## 1.0.16

### Patch Changes

- - Conditional as prop rerender issue fixes
- Provider without config issue fixes

## 1.0.15

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/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.15",
"version": "1.0.16",
"keywords": [
"React Native",
"Next.js",
Expand Down
25 changes: 15 additions & 10 deletions packages/react/src/styled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1054,15 +1054,16 @@ export function verboseStyled<P, Variants, ComCon>(

const prefixedMediaQueries: any = {};

Object.keys(CONFIG?.tokens?.mediaQueries).forEach((key: any) => {
prefixedMediaQueries[key] = {
key: `@${key}`,
isMediaQuery: true,
};
});
if (CONFIG?.tokens?.mediaQueries) {
Object.keys(CONFIG?.tokens?.mediaQueries).forEach((key: any) => {
prefixedMediaQueries[key] = {
key: `@${key}`,
isMediaQuery: true,
};
});
}

Object.assign(reservedKeys, { ...prefixedMediaQueries });

// for extended components

const EXTENDED_THEME =
Expand Down Expand Up @@ -1957,9 +1958,13 @@ export function verboseStyled<P, Variants, ComCon>(
componentConfig
);

const AsComp: any = React.useRef(
resolvedStyleProps.as || (passingProps.as as any) || undefined
).current;
// const AsComp: any = React.useRef(
// resolvedStyleProps.as || (passingProps.as as any) || undefined
// ).current;

const AsComp: any = React.useMemo(() => {
return resolvedStyleProps.as || (passingProps.as as any) || undefined;
}, [resolvedStyleProps.as]);

let resolvedStyleMemo = [passingProps?.style, ...resolvedStyleProps?.style];
if (Platform.OS === 'web') {
Expand Down

0 comments on commit 58a2219

Please sign in to comment.