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

Release/@gluestack style/[email protected]
  • Loading branch information
ankit-tailor authored Jun 8, 2023
2 parents 7fc9845 + e572e80 commit c27d506
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 14 deletions.
6 changes: 3 additions & 3 deletions example/babel-plugin-styled-resolver-expo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"build:web": "expo export:web"
},
"dependencies": {
"@gluestack-style/react": "^0.1.19",
"@gluestack-style/react": "^0.1.20",
"expo": "~47.0.8",
"expo-status-bar": "~1.4.2",
"find-yarn-workspace-root": "^2.0.0"
Expand All @@ -26,10 +26,10 @@
"babel-plugin-relative-path-import": "^2.0.1",
"ts-loader": "~8.2.0",
"typescript": "^4.6.3",
"@gluestack-style/react": "^0.1.19"
"@gluestack-style/react": "^0.1.20"
},
"peerDependencies": {
"@gluestack-style/react": "^0.1.19",
"@gluestack-style/react": "^0.1.20",
"react": "*",
"react-dom": "*",
"react-native": "*",
Expand Down
2 changes: 1 addition & 1 deletion example/expo-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"@gluestack-style/babel-plugin-styled-resolver": "^0.1.0",
"@gluestack-style/react": "^0.1.19",
"@gluestack-style/react": "^0.1.20",
"expo": "~47.0.12",
"expo-status-bar": "~1.4.2",
"react": "18.1.0",
Expand Down
2 changes: 1 addition & 1 deletion example/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"react-native-vector-icons": "^9.1.0",
"react-native-vector-icons-for-web": "^0.1.7",
"react-native-web-linear-gradient": "^1.1.2",
"@gluestack-style/react": "^0.1.19",
"@gluestack-style/react": "^0.1.20",
"@gluestack-style/babel-plugin-styled-resolver": "^0.1.6"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions example/storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"dependencies": {
"@gluestack-style/animation-plugin": "^0.1.7",
"@gluestack-style/react": "^0.1.19",
"@gluestack-style/react": "^0.1.20",
"@gluestack/design-system": "latest",
"@legendapp/motion": "^2.2.0",
"@react-native-async-storage/async-storage": "~1.17.3",
Expand All @@ -43,7 +43,7 @@
"devDependencies": {
"@babel/core": "^7.19.3",
"@gluestack-style/animation-plugin": "^0.1.7",
"@gluestack-style/react": "^0.1.19",
"@gluestack-style/react": "^0.1.20",
"@storybook/addon-actions": "^6.5.14",
"@storybook/addon-controls": "^6.5.14",
"@storybook/addon-docs": "^6.5.15",
Expand All @@ -69,7 +69,7 @@
"typescript": "4.9.4"
},
"peerDependencies": {
"@gluestack-style/react": "^0.1.19",
"@gluestack-style/react": "^0.1.20",
"react": "*",
"react-dom": "*",
"react-native": "*",
Expand Down
2 changes: 1 addition & 1 deletion packages/benchmark-next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
"devDependencies": {
"@gluestack-style/babel-plugin-styled-resolver": "^0.1.6",
"@gluestack-style/react": "^0.1.19",
"@gluestack-style/react": "^0.1.20",
"@emotion/styled": "^11.3.0",
"@expo/next-adapter": "^4.0.13",
"@types/react": "17.0.1",
Expand Down
6 changes: 6 additions & 0 deletions packages/react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @gluestack-style/react

## 0.1.20

### Patch Changes

- - Multiple provider context ids

## 0.1.19

### 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": "0.1.19",
"version": "0.1.20",
"keywords": [
"react",
"native",
Expand Down
7 changes: 4 additions & 3 deletions packages/react/src/StyledProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ export const StyledProvider: React.FC<{
children?: React.ReactNode;
globalStyles?: any;
}> = ({ config, colorMode, children, globalStyles }) => {
const id = React.useId();

const currentConfig = React.useMemo(() => {
//TODO: Add this later
return platformSpecificSpaceUnits(config, Platform.OS);
// return config;
}, [config]);

if (Platform.OS === 'web' && globalStyles) {
Expand Down Expand Up @@ -74,8 +75,8 @@ export const StyledProvider: React.FC<{
}

let contextValue = React.useMemo(() => {
return { config: currentConfig };
}, [currentConfig]);
return { config: currentConfig, id };
}, [currentConfig, id]);

return (
<StyledContext.Provider value={contextValue}>
Expand Down
6 changes: 5 additions & 1 deletion packages/react/src/styled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,11 @@ export function verboseStyled<P, Variants, Sizes>(
}, []);

if (!styleHashCreated) {
const themeHash = BUILD_TIME_PARAMS?.themeHash || stableHash(theme);
const themeHash =
styledContext.id +
'-' +
(BUILD_TIME_PARAMS?.themeHash || stableHash(theme));

// TODO: can be imoroved to boost performance
componentExtendedConfig = CONFIG;
if (ExtendedConfig) {
Expand Down

0 comments on commit c27d506

Please sign in to comment.