carbon
carbon copied to clipboard
Typescript : SelectProps interface is not exported
Package
@carbon/react
Browser
No response
Package version
V1.57.0
React version
V18.3.0
Description
The selectProps interface of the <Select> component is not exported.
This means that to wrap the component with third-party libs (Formik for example) we need to redeclare the interface.
Reproduction/example
Create a tsx component that wraps a <Select> component
Steps to reproduce
export function SelectField({ id, ...props }: MyFieldProps<SelectProps>) { // <- can't Access SelectProps
return (
<Field name={[props.name](http://props.name/)}>
{({ field, meta }: FieldProps) => (
<Select
invalidText={meta.error}
{...field}
{...props}
/>
)}
</Field>
);
}
Suggested Severity
Severity 3 = User can complete task, and/or has a workaround within the user experience of a given component.
Application/PAL
No response
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
- [X] I checked the current issues for duplicate problems
:100:
Out of abundance of explicitness ... please do make sure other xxxProps interfaces are exported too.