1.0.8 • Published 2 years ago

react-html-markup v1.0.8

Weekly downloads
19
License
ISC
Repository
github
Last release
2 years ago

react-html-markup

[react-html-markup]

An HTML to React parser that works on the server and the browser:

It converts an HTML string to React elements.

Example

In React JS (Hooks)
--------------------

import React from 'react';
import Markup from 'react-html-markup';

const Foo = () {
  const dbString = '<p>Hello from <b>React HTML Markup</b></p>';
  return (
    <Markup
      htmlString={ dbString } // html string that is coming from database or static html string.
      htmlTag='div' // You can add any html tag
      ... // You can add multiple attributes here like (class, data-title, style), that will apply on htmlTag you defined (div)
    />
  );
}
export default Foo;


Output show in Browser:
-----------------------
<div><p>Hello from <b>React HTML Markup</b></p></div>

Installation

NPM:

$ npm install react-html-markup --save

Yarn:

$ yarn add react-html-markup
1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago