Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This type error was happening because when we call the accessor to get the cell data for the row we could be passing either the row data or a wrapper object that contains the row data in one of its properties.
Since no logic required any of the data in the row wrapper, it made sense to move the check of what type of data we have up a level. So I added a new map before the big map logic to make sure we always have the row data and not the wrapper.
Types
I updated the generic constraints across the board to match what React Table expects. This helped me find the issue with the row and row wrapper.
While these changes aren't necessary for the fix, I think they improve the code quality and will help find future issues.
Automated testing
This logic is super complicated and interwoven. I'd love to have it under some tests. But in the interest of time I haven't added any in this PR.
If we consider it important enough, we can add a new GitHub issue to add some tests as a follow up change.
Validation
Related Issues
Check List
pnpm run checks
to ensure code compiles and meets standards.pnpm run test
to check if all tests are passing.