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

Release/@gluestack style/[email protected] #535

Merged
merged 6 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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