Allow context menu rerendering for <Table /> #7638
Open
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.
Checklist
Changes proposed in this pull request:
Add
bodyContextMenuRendererDependenciesas a prop to<Table />so that consumers can specify what dependencies will trigger a re-render of the Table's context menu content.This is useful for cases where a menu item might be disabled until some asynchronous event has occurred and the user should see the UI update in real-time rather than having to close the context menu and re-open it again.
Reviewers should focus on:
table.tsx+tableBody.tsxI tried to follow the precedent for
cellRendererDependenciesas closely as possible, but chose to implement the re-render triggering in a simpler way by changing the context menu render function reference.Video
I've updated the
table-dev-appto render the current time in the table context menu (just because it's something that updates asynchronously) to demonstrate that the context menu re-renders:Screen.Recording.2025-11-14.at.12.59.55.mov