DataTable: PassThrough types does not match actual values
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- react, typescript
- Domain
- frontend
Research direction
Start at the DataTable passthrough types exposed through PrimeReactPTOptions and trace the bodyRow(options) entry point. Compare the declared context type with the DataTableBodyRowContext described in the issue, then verify that bodyRow context is typed consistently rather than as DataTableContext or any.
Written by the indexing model from the issue text.
Description
Describe the bug
When styling with Tailwind through theming, it is needed to type the passthrough options like so -> datatablePT: Pick<PrimeReactPTOptions, "datatable">
When trying to access the context for a bodyRow in passthrough options for DataTable the type for context is DataTableContext and not DataTableBodyRowContext.
bodyRow({ context }) -> context is type any
bodyRow(options) => options?.context is type DataTableContext
Reproducer
No response
System Information
System:
OS: Windows 11 10.0.22631
CPU: (12) x64 Intel(R) Core(TM) i7-10850H CPU @ 2.70GHz
Memory: 18.29 GB / 31.85 GB
Binaries:
Node: 22.15.1 - C:\Program Files\nodejs\node.EXE
Yarn: 4.9.2 - C:\Program Files\nodejs\yarn.CMD
npm: 10.9.2 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 143.0.7499.41
Edge: Chromium (140.0.3485.54)
Firefox: 122.0 - C:\Program Files\Mozilla Firefox\firefox.exe
Internet Explorer: 11.0.22621.3527
npmPackages:
primereact: ^10.9.7 => 10.9.7
react: ^19.1.1 => 19.1.1
tailwindcss: ^4.1.13 => 4.1.13
Steps to reproduce the behavior
- Create a passthrough styling object for the
DataTablecomponent, used for theming and not directly on the component. - Add the type for the
DataTablecomponent fromimport type { PrimeReactPTOptions } from "primereact/api" - Type the passthrough styling object like
Pick<PrimeReactPTOptions, "datatable"> - Create styling for bodyRow
bodyRow(options) - Check that the
options.contextexists and that the type is wrong ->DataTableContext
Expected behavior
I would expect that the type for context in bodyRow is DataTableBodyRowContext and not the parent context type.
- Dominant language
- CSS
- Stars
- 8.3k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from primefaces/primereact
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
primefaces/primereact#8552 ·
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
primefaces/primereact#8550 ·
-
Row checkbox selection tick is invisible in Landing Page Theme sectionPossibly taken @Prakash1185 claimed this 173 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
primefaces/primereact#8545 ·
-
Dependency conflict between jspdf v4 and jspdf-autotable during npm installPossibly taken @Kamran92 claimed this 187 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
primefaces/primereact#8537 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 58/100
primefaces/primereact#8551 ·
All issues in primefaces/primereact
Similar issues
-
[BUG]: Shared links drop the configured basePath on GitHub PagesPossibly taken @anshulchikhale30-p claimed this today. Openbug
Difficulty 1/5 Under an hour Newbie friendliness 88/100
StabilityNexus/IdentityTokens-EVM-Frontend#182 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 Under an hour Newbie friendliness 82/100
Leonxlnx/taste-skill#216 ·
Maintainers usually reply within 1 day
-
area: ui Bug Payload OSS
Difficulty 1/5 Under an hour Newbie friendliness 88/100
payloadcms/payload#19839 ·
Maintainers usually reply within 1 day
-
BoxShadow.lerp returns the wrong blur style at t = 0 or t = 1Possibly taken @ArtemChikolaev claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
Maintainers usually reply within 1 day