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

className prop is missing in types.d.ts define of ISelectProps, not inherited from elsehwere #33

Closed
stephen-dirtcreative opened this issue Sep 10, 2019 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@stephen-dirtcreative
Copy link

Creating a select in a typescript environment: (pseudo code)

let options, // = options from somewhere
  onChange // = onChange from somewhere
<Select className={'class'} options={options} values={[]} onChange={onChange}/>

yields the error:
Property 'className' does not exist on type 'IntrinsicAttributes & ISelectProps & { children?: ReactNode; }'.

Observing types.d.ts in the npm package, there is no entry for className. Fixable by adding a line like:
className?: string; to interface ISelectProps

Workaround is to add monkey patch in code files that need className for Select:

...
declare module 'react-dropdown-select' {
  interface ISelectProps {
    className?: string;
  }
}
...
@sanusart sanusart added bug Something isn't working good first issue Good for newcomers labels Sep 13, 2019
@sanusart
Copy link
Owner

Fixed in 3.5.1 Thanks

@sanusart sanusart reopened this Sep 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants