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 #556 from gluestack/hotfix/ref-issue-with-plugin-c…
Browse files Browse the repository at this point in the history
…omponents

Hotfix: ref issue with plugin components
  • Loading branch information
rayan1810 authored Dec 4, 2023
2 parents c8fa704 + 1b390f3 commit 9ac7d3a
Show file tree
Hide file tree
Showing 4 changed files with 290 additions and 5 deletions.
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

## 1.0.22

### Patch Changes

- Hotfix: rolled back to non changing reference of styled component in component middleware.

## 1.0.21

### 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.21",
"version": "1.0.22",
"keywords": [
"React Native",
"Next.js",
Expand Down
8 changes: 4 additions & 4 deletions packages/react/src/styled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1981,14 +1981,14 @@ export function verboseStyled<P, Variants, ComCon>(
// }

const ComponentWithPlugin = React.useMemo(() => {
let MyComponent = Component;
if (plugins) {
for (const pluginName in plugins) {
// @ts-ignore
if (plugins[pluginName]?.componentMiddleWare) {
// @ts-ignore
MyComponent = plugins[pluginName]?.componentMiddleWare({
Component: MyComponent,
Component = plugins[pluginName]?.componentMiddleWare({
Component: Component,

theme,
componentStyleConfig,
ExtendedConfig,
Expand All @@ -1999,7 +1999,7 @@ export function verboseStyled<P, Variants, ComCon>(
}
}
}
return MyComponent;
return Component;
}, []);

let component;
Expand Down
Loading

0 comments on commit 9ac7d3a

Please sign in to comment.