-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Cannot import SelectItem in TypeScript #2983
Labels
Component: Documentation
Issue or pull request is related to Documentation
Typescript
Issue or pull request is *only* related to TypeScript definition
Milestone
Comments
bear-bibeault
added
Status: Needs Triage
Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Type: Bug
Issue contains a defect related to a specific component.
labels
Jun 9, 2022
melloware
removed
the
Status: Needs Triage
Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
label
Jun 9, 2022
Fixed already in master for 8.2.0 see this ticket: #2945 |
Actually let me look at this |
This is the correct import... import { SelectItem } from "primereact/selectitem"; |
melloware
added
the
Component: Documentation
Issue or pull request is related to Documentation
label
Jun 9, 2022
melloware
added a commit
to melloware/primereact
that referenced
this issue
Jun 9, 2022
What OS are you running on as well? |
melloware
added a commit
that referenced
this issue
Jun 9, 2022
melloware
added
Typescript
Issue or pull request is *only* related to TypeScript definition
and removed
Type: Bug
Issue contains a defect related to a specific component.
labels
Jun 9, 2022
macOS Mojave |
OK good I am pretty sure my fix for #2945 will fix your issue in 8.2.0 |
Thank you! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Component: Documentation
Issue or pull request is related to Documentation
Typescript
Issue or pull request is *only* related to TypeScript definition
Describe the bug
Using 8.1.1
The Get Started states that you can import
SelecItem
via:But TS complains:
Module '"primereact/api"' has no exported member 'SelectItem'.
, and indeed,api.d.ts
contains no such type.Attempting to import directly via
import { SelectItem } from "primereact/selectitem";
also fails with TS complaining:However,
SelectItem
is not exported bydropdown.d.ts
so it cannot be imported from there.How does one go about importing
SelectItem
? I'd rather not resort to usingany
.Reproducer
https://codesandbox.io/s/primereact-test-forked-vtvy4x?file=/src/index.tsx
PrimeReact version
8.1.1
React version
18.x
Language
TypeScript
Build / Runtime
Create React App (CRA)
Browser(s)
No response
Steps to reproduce the behavior
Attempting to import
SelectItem
in various ways, including the manner shown in the Getting Started document, fails in various ways as noted in the report.Expected behavior
Ability to import
SelectItem
as described in the Getting Started document.The text was updated successfully, but these errors were encountered: