Handle empty Canvas data in Renderer#29
Open
tbreeze-zengenti wants to merge 2 commits into
Open
Conversation
…t for multiple empty blocks and divider types
Member
|
Hi Tim, thanks very much for bringing this issue to our attention and offering a patch that resolves the immediate issues you encountered We have reviewed the change internally and we believe that patching the return value is likely to cause further issues downstream in other scenarios and as such will not be accepting this change as-is. So we can isolate the root cause of the issue(s) can we instead have a copy of the raw Canvas JSON output that is causing the problem(s) during Render? We can use this example to recreate the issue locally and give us the opportunity to find and fix the problem where it originates |
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.
When working with Canvas fields, the API may return different forms of "empty" data:
null, or[]Previously, consumers of the Canvas React Renderer had to implement their own checks to guard against these cases. Without these checks, rendering could fail or lead to unintended behavior. This inconsistency has also led to multiple internal utilities being created to sanitize the data before rendering.
The intention of this PR is to add a safeguard directly to the Renderer component to gracefully handle these edge cases.