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

Typescript : SelectProps interface is not exported #16545

Closed
2 tasks done
mamantor opened this issue May 22, 2024 · 2 comments · Fixed by #18106
Closed
2 tasks done

Typescript : SelectProps interface is not exported #16545

mamantor opened this issue May 22, 2024 · 2 comments · Fixed by #18106
Assignees

Comments

@mamantor
Copy link

mamantor commented May 22, 2024

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

@mamantor mamantor changed the title Typescript : SelectProps interface Is not exported Typescript : SelectProps interface is not exported May 22, 2024
@jfroffice
Copy link

jfroffice commented May 22, 2024

💯

@kubijo
Copy link
Contributor

kubijo commented Aug 28, 2024

Out of abundance of explicitness ... please do make sure other xxxProps interfaces are exported too.

@guidari guidari self-assigned this Sep 11, 2024
@guidari guidari moved this from ⏱ Backlog to 🚦 In Review in Design System Nov 19, 2024
@github-project-automation github-project-automation bot moved this from 🚦 In Review to ✅ Done in Design System Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

6 participants