This repository was archived by the owner on Oct 6, 2021. It is now read-only.
This repository was archived by the owner on Oct 6, 2021. It is now read-only.
question: Why use this custom way to pick default props? #7
Open
Description
currently default props are defined with
export type PickDefaultProps<Props, defaultPropsKeys extends keyof Props> = Readonly<Required<{
[P in defaultPropsKeys]: Props[P]
}>>;
and used like
type DefaultProps = PickDefaultProps<ButtonProps, 'state' | "size">;
why not do:
type DefaultProps = Partial<ButtonProps>;
using the built in Partial
type?
All the best, Sebastian