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.
|
omitProps.forEach((excludeProp) => { |
|
if ((restProps as Record<string, any>)[excludeProp]) { |
|
delete (restProps as Record<string, any>)[excludeProp] |
|
} |
|
}) |
shakl/src/index.ts
Lines 129 to 133 in 25dfacf