Cannot reduce marks when marks are not present
See original GitHub issueI am retrieving a Rich Text
field from my Contentful model and since I have not introduced any types into it, the GraphQL blows up when I try and retrieve them (because there are none).
If I remove the marks { type }
JSON blob part, the GraphQL executes successfully, but the rich-text-react-renderer
is expecting to have an existing object called marks
to apply some styling.
My surprise is that there’s no other way for me to create React components out of a JSON blob without marks.
I would expect that if part of the document that I am passing to the rich-text-react-renderer
component doesn’t contain marks, for it not to blow up and show the content without any marks…
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:12 (2 by maintainers)
Top Results From Across the Web
Change the Type of Mark in the View - Tableau Help
This article describes how to change the type of marks used in the view, and explains the different types of marks available. For...
Read more >I'm getting an error that the machine cannot read the cut ...
When Design Space tells you the machine cannot read the cut sensor marks, this means the image you are trying to cut is...
Read more >Crop Marks Cannot be Read - Download Center - Roland DG
Crop marks may not be read if the material has creases or wrinkles. ... If the size is expanded or reduced when printing,...
Read more >Marks - Cengage Platform Help
If shown, marks indicate whether the most recent answer you submitted was correct or incorrect. Note Marks are never shown for short answer,...
Read more >Stretch marks: Why they appear and how to get rid of them
Like any scar, stretch marks are permanent, but treatment may make them less noticeable. Treatment can also help alleviate the itch.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I was able to circumvent the same error by taking only the JSON data through GraphQL:
…and passing the JSON through to
documentToReactComponents
:Source: https://www.contentful.com/developers/docs/tutorials/general/rich-text-and-gatsby/
@cribbles you said:
But that is NOT happening.
For example, create a RTN and just type some text. There is no marks property created. Then go back and make the text italic or bold. Now there is a marks property.
So it seems the user has to do some kind of formatting otherwise there is no marks property. Is this because Contentful is not creating the marks property or is it because the GraphQL cannot see it if no formatting was applied?