-
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
DataTable/TreeTable: stricter generically typed API #2523
Labels
Type: Enhancement
Issue contains an enhancement related to a specific component. Additional functionality has been add
Typescript
Issue or pull request is *only* related to TypeScript definition
Milestone
Comments
yigitfindikli
added
the
Type: Enhancement
Issue contains an enhancement related to a specific component. Additional functionality has been add
label
Mar 22, 2022
melloware
added
Component: Documentation
Issue or pull request is related to Documentation
Typescript
Issue or pull request is *only* related to TypeScript definition
and removed
Component: Documentation
Issue or pull request is related to Documentation
labels
Apr 15, 2022
@DerDorius feel free to submit a PR! |
DariusRDev
added a commit
to DariusRDev/primereact
that referenced
this issue
Aug 28, 2022
Added Generics for Dropdown. Generics have to be also added in: cascadeselect.d.ts listbox.d.ts multiselect.d.ts selectbutton.d.ts because of the SelectItemOptionsType
DariusRDev
added a commit
to DariusRDev/primereact
that referenced
this issue
Aug 28, 2022
DariusRDev
added a commit
to DariusRDev/primereact
that referenced
this issue
Aug 28, 2022
DariusRDev
added a commit
to DariusRDev/primereact
that referenced
this issue
Aug 28, 2022
DariusRDev
added a commit
to DariusRDev/primereact
that referenced
this issue
Aug 28, 2022
DariusRDev
added a commit
to DariusRDev/primereact
that referenced
this issue
Aug 28, 2022
I figured we could keep DataTable/TreeTable as a separate PR/ticket. |
melloware
pushed a commit
that referenced
this issue
Aug 28, 2022
…ct, Selectbutton (#3199) * DataTable/TreeTable: stricter generically typed API #2523 Added Generics for Dropdown. Generics have to be also added in: cascadeselect.d.ts listbox.d.ts multiselect.d.ts selectbutton.d.ts because of the SelectItemOptionsType * #2523 Add Generics to Select Button * #2523 select button generics * #2523 Add Generics to CascadeSelect * #2523 add generics to List Box * #2523 Add Multiselect Generics
DataTable/TreeTable still need Generics right? Can I submit a PR for this? |
Yes please! |
bu3alwa
added a commit
to bu3alwa/primereact
that referenced
this issue
Dec 24, 2022
bu3alwa
added a commit
to bu3alwa/primereact
that referenced
this issue
Dec 24, 2022
melloware
added a commit
to melloware/primereact
that referenced
this issue
Dec 26, 2022
melloware
pushed a commit
that referenced
this issue
Dec 27, 2022
melloware
added a commit
to melloware/primereact
that referenced
this issue
Dec 27, 2022
melloware
added a commit
to melloware/primereact
that referenced
this issue
Dec 27, 2022
melloware
added a commit
to melloware/primereact
that referenced
this issue
Dec 27, 2022
melloware
added a commit
that referenced
this issue
Dec 27, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Type: Enhancement
Issue contains an enhancement related to a specific component. Additional functionality has been add
Typescript
Issue or pull request is *only* related to TypeScript definition
Codesandbox Case (Bug Reports)
Current behavior
The Tables have a lot of
any
s in them:And many more.
any
is not just a type - it disables static typing. TS actually recommends not using it all.This makes code using Tables less resilient to PrimeReact update changes, less type safe in general (selection should consist of data entiries, but this is not checked), and makes PrimeReact API harder to understand (e.g. rowClassName and cellClassName both accept the data argument - what is it? You have to run some code to figure that out).
Expected behavior
Avoid
any
and bind associated types with generics. E.g.:Minimal reproduction of the problem with instructions
Please tell us about your environment:
React version:
PrimeReact version:
7.1.0
Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
Language: [all | TypeScript X.X | ES6/7 | ES5]
The text was updated successfully, but these errors were encountered: