Skip to content

Using new functions don't trigger a render on the Table rows #3620

Description

@josejulio

Describe the issue. What is the expected and unexpected behavior?

I'm providing a new functions to onCollapse (The same should apply for other params that are functions) due to some changes in my state while using React hooks, but the new function is not applied to every row.

Please provide the steps to reproduce. Feel free to link CodeSandbox or another tool.

Check the reproducer:
https://codesandbox.io/s/agitated-cannon-gd2ny

Peek 2020-01-29 23-06

Step 1- Close the first - It closes correctly
Step 2- Close the second - It closes but opens the first.

Reason of "Step 2" outcome, is because is using an old onCollapse function that has an old state. The row is not being rendered again with the new onCollapse funcition.

Is this a bug or enhancement? If this issue is a bug, is this issue blocking you or is there a work-around?

Bug, the issue is blocking me, no know workaround when using hooks.

What is your product and what release version are you targeting?
Custom Policies https://github.com/RedHatInsights/custom-policies-ui-frontend

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions