Skip to content

Allow getter hooks to reuse the previous props #1749

@kizu

Description

@kizu

I'm digging into the getter hooks, like the getCellProps etc. — what I'm wondering is if it is somehow possible right now to access the previous values of the props, in order to manually merge/reuse them?

Example: I want to access the current colSpan, and add some styles based on it or modify it. But from what I've seen, this is not possible from the hooks. If I'm not missing something, then I can see this could be added in one of the following ways:

  1. Getter hooks could have the third argument after the Cell and TableInstance, which would contain the currently accumulated props.

  2. Alternatively, the currently accumulated props could be probably stored inside a Cell?

Currently, I can see that the only way of doing what I want is outside of a plugin-hook, by using the cell.getCellProps() during the Table generation and passing its values to my other function. But I feel that having a way to access the props from the previous hooks could be very powerful and could allow to create quite flexible plugin-hooks :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions