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

Typescript error with missing selectsMultiple #5198

Open
MrMamen opened this issue Oct 28, 2024 · 2 comments
Open

Typescript error with missing selectsMultiple #5198

MrMamen opened this issue Oct 28, 2024 · 2 comments

Comments

@MrMamen
Copy link

MrMamen commented Oct 28, 2024

Describe the bug
Typescript states there is an error if I Omit 'onChange' | 'selectsRange' | 'selectsMultiple'

Property selectsMultiple is missing in type .... but requried in type ...

Error from version 7.5.0

To Reproduce
Steps to reproduce the behavior:

import React from 'react';
import DatePicker, { DatePickerProps } from 'react-datepicker';

export interface WrapperProps {
  elementProps: Omit<
    DatePickerProps,
    'onChange' | 'selectsRange' | 'selectsMultiple'
  >;
}
export const DatePickerWrapper: React.FC<WrapperProps> = ({ ...props }) => {
  const { elementProps } = props;
  return <DatePicker {...elementProps} />;
};

Expected behavior
Works in 7.4.0

@MrMamen MrMamen closed this as completed Nov 6, 2024
@MrMamen MrMamen reopened this Nov 8, 2024
@haroldekstrom
Copy link

Just upgraded to 7.5.0 and I'm seeing this too with very similar code. Don't understand why, the types don't seem to have changed.

@CsepanBotond
Copy link

CsepanBotond commented Nov 13, 2024

I experience it in 7.3.0 as well (with corresponding @types at 6.2.0)

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

No branches or pull requests

3 participants