Company
Date Published
Author
Dan Polant
Word count
937
Language
English
Hacker News points
None

Summary

You can store content in Contentful if it needs to be managed directly by the marketing team without a developer's involvement, is Rich Text (e.g., markup like lists or images), requires a publishing workflow, or needs translations into multiple languages. The "Keyed Rich Text" pattern is a generic approach to making segments of Rich or plain text available to your app's frontend, involving giving it a human-readable key, an administrative title, and a Rich Text field. To get content from Contentful into your React app, you can use the Content Delivery API access token, functions like getKeyedContentMultiple, and the documentToReactComponents function from the contentful/rich-text-react-renderer package to render the contents of Rich Text fields.