From 1362fa7f6fd1958b7175022857727e4d8c852837 Mon Sep 17 00:00:00 2001 From: Junior Garcia Date: Sat, 16 Sep 2023 17:57:23 -0300 Subject: [PATCH 1/2] fix(core): extend variants function, destructuring order changed --- packages/core/system-rsc/src/extend-variants.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/system-rsc/src/extend-variants.js b/packages/core/system-rsc/src/extend-variants.js index f14d6959b9..a25578f212 100644 --- a/packages/core/system-rsc/src/extend-variants.js +++ b/packages/core/system-rsc/src/extend-variants.js @@ -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 = {}; From cca0f99b6a9bc5f7e2034aafb0addac150e7b034 Mon Sep 17 00:00:00 2001 From: Junior Garcia Date: Sat, 16 Sep 2023 17:59:22 -0300 Subject: [PATCH 2/2] chore(core): changeset added --- .changeset/moody-fans-stare.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/moody-fans-stare.md diff --git a/.changeset/moody-fans-stare.md b/.changeset/moody-fans-stare.md new file mode 100644 index 0000000000..b3e62f9aa0 --- /dev/null +++ b/.changeset/moody-fans-stare.md @@ -0,0 +1,5 @@ +--- +"@nextui-org/system-rsc": patch +--- + +Fix #1541 `extendVariants`function gives more priority to final component props over the `extendVariants` props