You can use dangerouslySetInnerHTML

Source: https://reactjs.org/docs/dom-elements.html#dangerouslysetinnerhtml

const text = '<p>Hello<strong> World</strong></p><p><strong>Next Line</strong></p>';

<div dangerouslySetInnerHTML={{__html:text}} />
Answer from Akash Gupta on Stack Overflow
🌐
npm
npmjs.com › package › convert-rich-text
convert-rich-text - npm
May 2, 2023 - var convert = require('convert-rich-text'); var html = convert(delta, formats, options); // last argument optional
      » npm install convert-rich-text
    
Published   May 02, 2023
Version   6.1.0
Author   Blake Thomson
Discussions

How to convert rich text format to display in react
have rich text format fetched from mssql database and i want to display it correctly in my react application, and can’t seem to find any library and also i need a library with typescript(type safed),any ideas. here is how RTF looks: {\rtf1\fbidis\ansi\ansicpg1252\deff0\deflang1033{\fontt... More on forum.freecodecamp.org
🌐 forum.freecodecamp.org
0
0
March 1, 2024
Rich text editor that supports html
https://remirror.io https://lexical.dev https://tiptap.dev More on reddit.com
🌐 r/reactjs
6
2
August 20, 2024
Reframed - How to convert plain text to html code.
Are you thinking of something like Markdown? Or perhaps you want a rich text editor, something like Draft.js? More on reddit.com
🌐 r/reactjs
5
3
May 28, 2022
How to deal with Rich Text in React?
I have used this myself with Gatsby. Works really well and you can swap out html nodes it gets from your string with react components - in my case this was useful as I was using styled-components More on reddit.com
🌐 r/reactjs
11
12
October 28, 2017
🌐
Hygraph
hygraph.com › blog › hygraph-rich-text-react
Working with Rich Text and React | Hygraph
January 21, 2026 - import { RichText } from '@hygraph/rich-text-react-renderer';Copy · We'll now take the Rich Text AST (json + references) and convert it to HTML, providing the references, and custom renderers using the RichText component:
🌐
Payload
payloadcms.com › docs › rich-text › converting-html
Converting HTML | Documentation | Payload
To convert JSON to HTML on-demand, use the convertLexicalToHTML function from @payloadcms/richtext-lexical/html. Here's an example of how to use it in a React component in your frontend:
🌐
Medium
medium.com › oberonamsterdam › an-elegant-way-to-deal-with-rich-text-fields-in-react-66ff82518318
An elegant way to deal with rich text fields in React. | by Jari Zwarts | Oberon | Medium
March 29, 2021 - Because I’m used to ‘thinking in react’, I wanted something more declarative. ... All we need to use this component is provide the HTML string itself, and a simple mapping from tag names to our own components.
🌐
Contentful
contentful.com › developers › docs › tutorials › general › getting-started-with-rich-text-field-type
Getting started with Rich Text | Contentful Docs
Render all the contents of a JSON response to HTML. Apply a custom rendering function to an embedded entry. Apply a custom rendering function to a default node, like a heading or a link, thereby applying personalized style and logic to the markup of an application. Following is an example of adding CSS classes to paragraph tags in JavaScript in order to alternate their background color: import React from 'react'; import ReactDOM from 'react-dom'; import { BLOCKS } from '@contentful/rich-text-types'; import { documentToReactComponents } from '@contentful/rich-text-react-renderer'; const richTex
🌐
npm
npmjs.com › package › @contentful › rich-text-react-renderer
@contentful/rich-text-react-renderer - npm
3 weeks ago - Start using @contentful/rich-text-react-renderer in your project by running `npm i @contentful/rich-text-react-renderer`. There are 161 other projects in the npm registry using ...
      » npm install @contentful/rich-text-react-renderer
    
Published   Apr 09, 2026
Version   16.2.1
Find elsewhere
🌐
Contentful
contentful.com › developers › docs › javascript › tutorials › rendering-contentful-rich-text-with-javascript
Rendering Contentful Rich Text with Javascript | Contentful Docs
Contentful offers many tools to help you work with our Rich Text feature. This guide is meant to help put the pieces together and provide resources for learning more. It focuses majorly on Contentful's client library, rich-text-html-renderer, and rich-text-react-renderer to render your Rich Text fields with HTML.
🌐
Marmelab
marmelab.com › react-admin › RichTextInput.html
React-admin - The RichTextInput Component
<RichTextInput> lets users edit rich text in a WYSIWYG editor, and store the result as HTML. It is powered by TipTap. ... Due to its size, <RichTextInput> is not bundled by default with react-admin.
🌐
freeCodeCamp
forum.freecodecamp.org › javascript
How to convert rich text format to display in react - JavaScript
March 1, 2024 - have rich text format fetched from mssql database and i want to display it correctly in my react application, and can’t seem to find any library and also i need a library with typescript(type safed),any ideas. here is how RTF looks: {\rtf1\fbidis\ansi\ansicpg1252\deff0\deflang1033{\fontt...
🌐
Reddit
reddit.com › r/reactjs › rich text editor that supports html
r/reactjs on Reddit: Rich text editor that supports html
August 20, 2024 -

I am looking for library that provided text editor that can support images and html , bold , italic and etc. I am using now quill but I don’t know how can I setup it for html.

🌐
Syncfusion
syncfusion.com › react › rich text editor
React Rich Text Editor | Advanced WYSIWYG Features | Syncfusion
As Markdown syntax such as # for headings, ** for bold, and * for italics are typed, the editor automatically converts it into HTML elements. Checklists (to-do lists) can be created directly within the Rich Text Editor. Users can easily add interactive checkbox items to their content, enabling task tracking and management within documents. Create ordered (numbered) or unordered (bulleted) lists to organize the content in the React Rich Text Editor.
Published   November 14, 2025
🌐
Reddit
reddit.com › r/reactjs › reframed - how to convert plain text to html code.
r/reactjs on Reddit: Reframed - How to convert plain text to html code.
May 28, 2022 -

I asked this question earlier but seems i didn't frame it properly. So here is the problem. There is some storage which stores html files with some content in it. The storage is done using an API which accepts html string, created a file and stores the html string as .html file.

Now my problem on React side is, there is an input box where user types the content which I want to convert to html code. When user types it, it is just plain text. What I want is a Library that course go through the text and place p, div, h1 etc tags in appropriate places so that I can then send this as html string to the API.

🌐
Storyblok
storyblok.com › faq › how-to-render-the-rich-text-field-using-react-js
How to render the rich-text field using react js? | Storyblok
You can use the richTextResolver from our javascript SDK in your React.js components like in the code sample below. We recommend you to check also our Richtext field documentation out.
🌐
Reddit
reddit.com › r/reactjs › how to deal with rich text in react?
r/reactjs on Reddit: How to deal with Rich Text in React?
October 28, 2017 -

Hi,

I'm working on a Gatsby blog which imports content from Prismic.io This content includes Richt Text which I transform to HTML using prismic-dom.

What is the best way to deal with this html output in React?

Right now I'm just using 'dangerouslySetInnerHTML' but this leaves me with loads of extraneous divs, and the syntax is also pretty ugly imo.

Example:

function renderIntro() {
    return d.intro.map(intro => (
      <div className="intro">
        <div dangerouslySetInnerHTML={{ __html: intro.intro_title.html }}></div>
        <div dangerouslySetInnerHTML={{ __html: intro.intro_body.html }}></div>
      </div>
    ));
  } 

Is there a better way of doing this?

🌐
Stack Overflow
stackoverflow.com › questions › 65496076 › how-do-i-convert-and-display-richtext-in-react
html - How do I convert and display richtext in React? - Stack Overflow
How to transform plain text to html JSX in ReactJS · 16 · contentful api markdown conversion to HTML · 0 · React - Render HTML from JSON · 0 · ReactJS - JSON and HTML markup · 3 · Convert Markdown to HTML from within a Rich-Text Component with Gatsby ·
🌐
GitHub
github.com › contentful › rich-text
GitHub - contentful/rich-text: Libraries for handling and rendering Rich Text 📄
Converts rich text documents to plain text · rich-text-types · Type definitions and constants for the rich text field type · gatsby-transformer-contentful-richtext [DEPRECATED] Parses a Contentful Rich Text document to HTML in Gatsby · rich-text-react-renderer ·
Starred by 584 users
Forked by 109 users
Languages   TypeScript 97.3% | JavaScript 2.7%
🌐
Payload
payloadcms.com › community-help › discord › rendering-react-components-for-rich-text-blocks
Rendering react components for rich text blocks | Community Help | Payload
I did make some structure, naming and other edits. I tried to remove all styling as much as possible and keep it very generic. @360823574644129795 · In my opinion, by default Payload should provide both HTML Converters and ReactNodeConverters for all the default lexical node types like paragraph
🌐
Syncfusion
ej2.syncfusion.com › domain url › react › documentation › rich text editor › getting started
Getting Started with React Rich Text Editor Component | Syncfusion
To create Rich Text Editor with additional features, inject the required modules. The following modules are used to extend Rich Text Editor’s basic functionality. HtmlEditor - Inject this module to use Rich Text Editor as html editor.
🌐
npm
npmjs.com › package › react-richtext
react-richtext - npm
August 18, 2016 - In this editor we use a pure, deterministic function to convert document state to HTML output. No matter how you arrived at the state, the output will be predictable. This makes everything easier to reason about. In our case, the <strong> will go inside the <em> every time. value: Used to represent the content/state of the editor. Initially you will probably want to create an instance using a provided helper such as RichTextEditor.createEmptyValue() or RichTextEditor.createValueFromString(markup, 'html').
      » npm install react-richtext
    
Published   Aug 18, 2016
Version   1.1.0