From 9aa861fe1935909bd411c84686b860ca338d9639 Mon Sep 17 00:00:00 2001 From: p-sw Date: Tue, 21 May 2024 19:36:22 +0900 Subject: [PATCH] refactor: remove option to disable excluding --- packages/react/shared.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/react/shared.ts b/packages/react/shared.ts index 1435f70..7a181de 100644 --- a/packages/react/shared.ts +++ b/packages/react/shared.ts @@ -143,18 +143,15 @@ export function vcn({ * Otherwise, it will parse A as variant props. * * @param anyProps - Any props that have passed to the component. - * @param options - Options. * @returns [variantProps, otherProps] */ - (anyProps, options = {}) => { + (anyProps) => { const variantKeys = Object.keys(variants) as (keyof V)[]; return Object.entries(anyProps).reduce( ([variantProps, otherProps], [key, value]) => { if ( - variantKeys.includes(key) || - (!options.excludeClassName && key === "className") || - (!options.excludePreset && key === "preset") + variantKeys.includes(key) ) { return [{ ...variantProps, [key]: value }, otherProps]; } @@ -162,8 +159,8 @@ export function vcn({ }, [{}, {}] ) as [ - Partial> & { className?: string }, - Omit> | "className">, + Partial>, + Omit> | "preset" | "className">, ]; }, ];