type FilterHtmlProps = ( allComponentProps: P, excludingProps: string[], ) => A; export const filterProps: FilterHtmlProps = (allComponentProps, excludingProps: string[]) => { return Object.entries(allComponentProps).reduce((filteredProps, [key, value]) => { if (!excludingProps.includes(key)) { filteredProps[key] = value; } return filteredProps; }, {}); };