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

[Feature Request]: Provide Typescript types for ContainedList and ContainedListItem #16206

Closed
1 task done
dnoliver opened this issue Apr 15, 2024 · 1 comment · Fixed by #16302
Closed
1 task done

Comments

@dnoliver
Copy link

The problem

When using ContainedList, the linter in vscode shows:

Module '"@carbon/react"' has no exported member 'ContainedList'.ts(2305)
Module '"@carbon/react"' has no exported member 'ContainedListItem'.ts(2305)

I think this is because ContainedList and ContainedListItem doesn't have a typescript definition:

$ find node_modules/@carbon/react/lib/components/ContainedList
node_modules/@carbon/react/lib/components/ContainedList
node_modules/@carbon/react/lib/components/ContainedList/ContainedList.js      
node_modules/@carbon/react/lib/components/ContainedList/ContainedListItem     
node_modules/@carbon/react/lib/components/ContainedList/ContainedListItem/ContainedListItem.js
node_modules/@carbon/react/lib/components/ContainedList/ContainedListItem/index.js

The solution

Add type definitions for those components!

Examples

For example, Buttons have types:

$ find node_modules/@carbon/react/lib/components/Button -name '*.ts'
node_modules/@carbon/react/lib/components/Button/Button.d.ts
node_modules/@carbon/react/lib/components/Button/Button.Skeleton.d.ts
node_modules/@carbon/react/lib/components/Button/ButtonBase.d.ts
node_modules/@carbon/react/lib/components/Button/index.d.ts

Examples can be taken from the repository

Application/PAL

N/A

Business priority

None

Available extra resources

N/A

Code of Conduct

Copy link
Contributor

Thank you for submitting a feature request. Your proposal is open and will soon be triaged by the Carbon team.

If your proposal is accepted and the Carbon team has bandwidth they will take on the issue, or else request you or other volunteers from the community to work on this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants