-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
Status: Needs TriageIssue will be reviewed by Core Team and a relevant label will be added as soon as possibleIssue will be reviewed by Core Team and a relevant label will be added as soon as possible
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.13Steps 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.
Metadata
Metadata
Assignees
Labels
Status: Needs TriageIssue will be reviewed by Core Team and a relevant label will be added as soon as possibleIssue will be reviewed by Core Team and a relevant label will be added as soon as possible