Skip to content

Faulty omitProps check #39

@ChALkeR

Description

@ChALkeR

if (restProps[excludeProp]) uses truthiness check instead of property existence check. Props with falsy values (e.g., theme={false}, theme={0}, theme="", theme={null}) will NOT be omitted from restProps and will be passed through to the underlying component. The intent is clearly to remove listed props regardless of value.

shakl/src/index.ts

Lines 129 to 133 in 25dfacf

omitProps.forEach((excludeProp) => {
if ((restProps as Record<string, any>)[excludeProp]) {
delete (restProps as Record<string, any>)[excludeProp]
}
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions