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

Missing className prop in v7.4.0 breaks compatibility with styled-components typescript #5111

Open
esetnik opened this issue Sep 23, 2024 · 0 comments

Comments

@esetnik
Copy link

esetnik commented Sep 23, 2024

Describe the bug
The className prop is omitted from DatePickerProps which breaks compatibility with styled-components

https://github.com/Hacker0x01/react-datepicker/blob/main/src/index.tsx#L119

To Reproduce
Steps to reproduce the behavior:

import DatePicker, { DatePickerProps } from 'react-datepicker';
import styled from 'styled-components/macro';

const Input = styled(DatePicker)<{
  invalid: boolean;
}>`
  padding-inline-end: 40px;

  ::placeholder {
    color: ${({ theme }) => theme.grey60};
    font-size: 0.875rem;
  }

  background-repeat: no-repeat;
  background-position: right 8px center;

  ${({ invalid }) => invalid && 'border-color: #dc3545'}
`;

Expected behavior
No type error as in v7.3.0

Screenshots
image

Desktop (please complete the following information):

  • OS: macOS
    ❯ ./node_modules/.bin/tsc -v
    Version 5.6.2

Additional context
Add any other context about the problem here.

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

1 participant