Skip to content

Commit

Permalink
fix(core): extend variants function, destructuring order changed (#1642)
Browse files Browse the repository at this point in the history
* fix(core): extend variants function, destructuring order changed

* chore(core): changeset added
  • Loading branch information
jrgarciadev authored Sep 16, 2023
1 parent 37d5f12 commit f6531c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/moody-fans-stare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nextui-org/system-rsc": patch
---

Fix #1541 `extendVariants`function gives more priority to final component props over the `extendVariants` props
2 changes: 1 addition & 1 deletion packages/core/system-rsc/src/extend-variants.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function extendVariants(BaseComponent, styles = {}, opts = {}) {
const ForwardedComponent = React.forwardRef((originalProps, ref) => {
const [baseProps, variantProps] = mapPropsVariants(originalProps, customTv.variantKeys, false);

const newProps = {...baseProps, ...defaultVariants, ref};
const newProps = {...defaultVariants, ...baseProps, ref};

let classNames = {};

Expand Down

2 comments on commit f6531c5

@vercel
Copy link

@vercel vercel bot commented on f6531c5 Sep 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on f6531c5 Sep 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.