Skip to content

A utility for converting HTML strings into React components

License

Notifications You must be signed in to change notification settings

JoakimSM/react-html-parser-ultimate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

react-html-parser-ultimate

A utility for converting HTML strings into React components

Installation

npm i react-html-parser-ultimate

or

yarn add react-html-parser-ultimate

Usage

import { parseHtml } from 'react-html-parser-ultimate';

parseHtml(html, {
    onTransform: (node, index, nodeToElementFn) => {
        if (node.name === 'div') {
            node.name = 'span';
            return nodeToElementFn(node, index);
        }
        return undefined;
    },
    allowScript: true,
});

About

A utility for converting HTML strings into React components

Resources

License

Stars

Watchers

Forks

Packages

No packages published