const { MenuList } = components;
const CustomMenuList = ({ ...props }: any) => {
console.log(props);
return (
<div>
<MenuList {...props} />
<hr className="m-0" />
<div
className="text-primary p-2 font-weight-bold c-pointer"
onClick={() => history.push(CUSTOM_POST.replace(':type', 'contact-roles'))}
>
+ Create New Role
</div>
</div>
);
};
I am using TypeScript. I am using Custom Component in ReactSelect.
What could be the type of props. I am not allowed to used any because of tslint.
<Select
components={{
MenuList: CustomMenuList,
}}
options={[...contactRoleOptions]}
/>
react-select exports MenuListComponentProps<OptionType> If you have not added anything then it should be just that...
OptionsType being the type you pass to options
Menu.d.ts
export type MenuListComponentProps<OptionType> = CommonProps<OptionType> &
MenuListProps &
MenuListState;