Closed devotox closed 1 year ago
I find myself doing something like this quite often
export const sanitizeProps = (props, allowedProps) => Object.keys(props) .filter(propName => !allowedProps.includes(propName)) .reduce((acc, key) => ({ ...acc, [key]: props[key] }), {});
D.selectKeys works
I find myself doing something like this quite often