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 memoization dependencies in useTrWithBatteries #7

Merged
merged 1 commit into from
Dec 20, 2023

Conversation

mturley
Copy link
Collaborator

@mturley mturley commented Dec 20, 2023

Here's an issue caused by the tech debt described in #6. I neglected to include the selection and expansion state in the useDeepCompareMemo dependency array for useTrWithBatteries. When selection state changed, the reference to the Tr component being rendered was not updated and was using an out of date copy of the batteries object, so the checkbox didn't check even though the item was selected in state.

cc @gitdallas

…ing when selection changed

Signed-off-by: Mike Turley <[email protected]>
@gitdallas gitdallas self-requested a review December 20, 2023 20:01
@mturley mturley merged commit 521b65c into patternfly-labs:main Dec 20, 2023
4 checks passed
@mturley mturley deleted the fix-selection branch December 20, 2023 20:03
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.

2 participants