diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md index b8421291..74b58d38 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -1,5 +1,11 @@ # @gluestack-style/react +## 1.0.19 + +### Patch Changes + +- Fixed component refrence issue for plugins [PR](https://github.com/gluestack/gluestack-style/pull/547) + ## 1.0.18 ### Patch Changes diff --git a/packages/react/package.json b/packages/react/package.json index b3558725..5c3ace6c 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,7 +1,7 @@ { "name": "@gluestack-style/react", "description": "A universal & performant styling library for React Native, Next.js & React", - "version": "1.0.18", + "version": "1.0.19", "keywords": [ "React Native", "Next.js", diff --git a/packages/react/src/styled.tsx b/packages/react/src/styled.tsx index f83ad31e..2fcd0892 100644 --- a/packages/react/src/styled.tsx +++ b/packages/react/src/styled.tsx @@ -1979,13 +1979,14 @@ export function verboseStyled( // } const ComponentWithPlugin = React.useMemo(() => { + let MyComponent = Component; if (plugins) { for (const pluginName in plugins) { // @ts-ignore if (plugins[pluginName]?.componentMiddleWare) { // @ts-ignore - Component = plugins[pluginName]?.componentMiddleWare({ - Component: Component, + MyComponent = plugins[pluginName]?.componentMiddleWare({ + Component: MyComponent, theme, componentStyleConfig, ExtendedConfig, @@ -1996,7 +1997,7 @@ export function verboseStyled( } } } - return Component; + return MyComponent; }, []); let component;