Skip to content

Commit

Permalink
perf(system): reduce getter accesses
Browse files Browse the repository at this point in the history
  • Loading branch information
juanrgm committed May 13, 2023
1 parent c2226ae commit 5c0eb07
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/orange-bees-wave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@suid/system": patch
---

Reduce accesses to getter properties
6 changes: 2 additions & 4 deletions packages/system/src/createStyled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,13 +213,11 @@ function createStyled<
$component,
mergeProps(otherProps, {
get children() {
return (otherProps as any).children;
return (inProps as any).children;
},
// [review] This property must be omitted on each component individually.
get component() {
return is$ComponentStyled()
? (otherProps as any).component
: null;
return is$ComponentStyled() ? (inProps as any).component : null;
},
get as() {
return isComponentStyled ? inProps.as : undefined;
Expand Down

0 comments on commit 5c0eb07

Please sign in to comment.