Description
openedon Apr 29, 2022
Package
@carbon/react
Browser
No response
Package version
1.1.0
React version
not specific to a version of react
Description
When importing icons via the @carbon/react/icons
re-export, no auto-completions are provided in VS Code:
versus @carbon/icons-react
which looks like:
It doesn't look like the IDE auto-completion is smart enough to follow the combination of Object.keys
and Object.defineProperty
to provide the exhaustive list of icons that are available at runtime/build time.
Though I'm not sure exactly how to accomplish it, it seems like a more direct re-export of the icons from the require
d module would be what is needed to get past this.
There's also an info message that pops up in vscode for this import which is not present on the icons-react version:
versus icons-react which has a full-blown d.ts
file to which it links that provides type info:
CodeSandbox example
n/a
Steps to reproduce
- Install
@carbon/react
into a React project - Open a component file in an IDE like VS Code
- Attempt to import an icon from
@carbon/react/icons
- Observe that the auto-complete list does not show any of the available icons
Code of Conduct
- I agree to follow this project's Code of Conduct
- I checked the current issues for duplicate problems
Metadata
Assignees
Labels
Type
Projects
Status
✅ Done