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

Commit

Permalink
fix: as forwarder memo issue fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Suraj authored and Suraj committed Nov 16, 2023
1 parent 017d90c commit 8114c28
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/react/src/styled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1957,9 +1957,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 8114c28

Please sign in to comment.