Bug: Extending DayPickerProps causes typescript errors
pekarja5 opened this issue · comments
Bug description
Modification of DayPickerProps
causes typescript to fail with Type error: Expression produces a union type that is too complex to represent.
To reproduce
Try to create new type by using the provided type.
type DatepickerProps = Omit<DayPickerProps, 'locale'> & {
locale?: LocaleType;
};
Steps
- Create new type based on
DayPickerProps
- Try to compile the code
Thanks! Maybe related to #1718?
I was thinking if this change isn't the problem:
018c722#diff-3c1e8063978b6b28fc6cc3290e71ae52eb91d50bf5963c42b787829f61c1a19dR35
as the Omit is trying to exclude something from an infinite number of keys. But my typescript knowledge is not as deep to be sure of it.
@pekarja5 yes you were right – that was the bug.
I published the fix in https://github.com/gpbl/react-day-picker/releases/tag/v8.7.1, please report back if you still have issues. Thanks!