payload icon indicating copy to clipboard operation
payload copied to clipboard

fix: cell component types

Open jessrynkar opened this issue 1 year ago • 2 comments

Description

Closes #5923

The cell component prop types are incomplete because we are currently using Pick<> to add 'collection' | 'rowData' from the cell props, we should use Partial<> instead so any cell prop type can be accessed (but is not required).

  • [X] I have read and understand the CONTRIBUTING.md document in this repository.

Type of change

  • [X] Chore (non-breaking change which does not add functionality)

Checklist:

  • [X] Existing test suite passes locally with my changes

jessrynkar avatar Apr 25 '24 16:04 jessrynkar

When specifying a custom cell component in the Paylaod config, the component doesn't seem to receive props.data . Is props.data being used internally? If so, would it make sense to define two types, one for internal use, and one to be used by custom cell components provided in the config options? This is what the component currently receives:

{
    "cellData": 6,
    "colIndex": 6,
    "collection": Object,
    "field": Object,
    "link": true,
    "rowData": Object,
}

franciscolourenco avatar Apr 30 '24 01:04 franciscolourenco

Also, why use Partial<Props>? Are there situations in which not all the props are provided?

franciscolourenco avatar Apr 30 '24 01:04 franciscolourenco

Outdated

jessrynkar avatar Jul 15 '24 14:07 jessrynkar