Skip to content

Use custom Select Props #356

@guilbaultcarbo

Description

@guilbaultcarbo

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"> & { ...; }'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions