Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: types for selection modes not being correctly set #1571

Merged
merged 1 commit into from
Oct 3, 2022

Conversation

gpbl
Copy link
Owner

@gpbl gpbl commented Oct 2, 2022

No description provided.


/** The props for the {@link DayPicker} component when using `mode="default"` or `undefined`. */
export interface DayPickerDefaultProps extends DayPickerBase {
mode?: DaySelectionMode;
mode?: undefined | 'default';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You already have ? near mode so you don’t need to provide explicit undefined:

mode?: 'default'

Isn’t it?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually there's a setting in tsconfig where this would be required (I couldn't find which right now), so I'd better keep it explicit.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

FYI regarding ? and unsetting it :)

@gpbl gpbl merged commit 929dc32 into master Oct 3, 2022
@gpbl gpbl deleted the gpbl/selection-mode branch October 3, 2022 00:53
@VitaliyR
Copy link

VitaliyR commented Oct 3, 2022

Thanks for fixing this, I can now remove as any stubs to fix TS 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants