Skip to content
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

fix: cell component types #6038

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

JessChowdhury
Copy link
Member

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).

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

Type of change

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

Checklist:

  • Existing test suite passes locally with my changes

@franciscolourenco
Copy link
Contributor

franciscolourenco commented Apr 30, 2024

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
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrectly typed/exported CellComponentProps?
2 participants