expose renderers prop to allow custom internal renderers#969
Merged
lukasmasuch merged 3 commits intoglideapps:mainfrom Jun 19, 2025
Merged
expose renderers prop to allow custom internal renderers#969lukasmasuch merged 3 commits intoglideapps:mainfrom
lukasmasuch merged 3 commits intoglideapps:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR exposes a custom renderers prop to allow developers to override internal cell rendering behavior, potentially consolidating customRenderers into renderers while still supporting legacy internal cell renderers.
- Updated dependency installation script to include @testing-library/dom.
- Added a new test to verify that custom renderers can override internal cells.
- Modified the DataEditorAll component to accept a custom renderers prop.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| setup-react-18-test.sh | Updated dependency list to include @testing-library/dom. |
| packages/core/test/data-editor.test.tsx | Added test to check custom renderer override functionality. |
| packages/core/src/index.ts | Exposed InternalCellRenderer type for enhanced type-safety. |
| packages/core/src/data-editor-all.tsx | Modified DataEditorAll to support a custom renderers prop. |
Comments suppressed due to low confidence (1)
packages/core/test/data-editor.test.tsx:2590
- [nitpick] Review the need for the explicit type assertion to InternalCellRenderer; if possible, adjust the markerCellRenderer type to allow overriding the draw function without a type assertion.
draw: spy
lukasmasuch
approved these changes
Jun 18, 2025
Collaborator
lukasmasuch
left a comment
There was a problem hiding this comment.
LGTM 👍 Might be good to also list this in the API.md and maybe add one example to the custom drawing story or a new story.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Possibly solves #946.
In general, this PR allows developers to override rendering behavior for internal cells.
Internal cell renderers are already exposed.
Ideally, we could consolidate customRenderers into renderers, and only require rowMarkers and a basic text cell, the other renderers being optional.