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

Use custom Select Props #356

Open
guilbaultcarbo opened this issue Dec 9, 2024 · 0 comments
Open

Use custom Select Props #356

guilbaultcarbo opened this issue Dec 9, 2024 · 0 comments

Comments

@guilbaultcarbo
Copy link

Hello !
Is it possible to use custom Select props (declared with module augmentation as mentioned in react-select documentation) ?

I have something like this :

// react-select.d.ts

import type { LucideIcon } from "lucide-react";
import type {} from "react-select/base";

declare module "react-select/base" {
  export interface Props<
    Option,
    _IsMulti extends boolean,
    _Group extends GroupBase<Option>,
  > {
    Icon?: LucideIcon;
  }
}

And currently I have a typescript error when I try to pass an Icon to the selectProps :

Object literal may only specify known properties, and 'Icon' does not exist in type 'AsyncProps<Option, false, GroupBase<Option>>'.ts(2353)
types.d.ts(34, 5): The expected type comes from property 'selectProps' which is declared here on type 'IntrinsicAttributes & Omit<GooglePlacesAutocompleteProps & RefAttributes<GooglePlacesAutocompleteHandle>, "ref"> & { ...; }'
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