convert-text-to-react
TypeScript icon, indicating that this package has built-in type declarations

0.2.4 • Public • Published

convert-text-to-react

Build Status

Usage

npm i convert-text-to-react
import * as ReactDOM from "react-dom/server";
import { convert, ExampleComponent } from "convert-text-to-react";
 
const rawText = "<ExampleComponent x={1} y={-20}>Result of multiplication:</ExampleComponent>";
 
const components = {
  ExampleComponent,
}
 
const result = convert(rawText, components);
 
console.log(ReactDOM.renderToStaticMarkup(result);
// <div class="my-component">Result of multiplication: -20</div>

Licence

MIT

Author

Himenon

/convert-text-to-react/

    Package Sidebar

    Install

    npm i convert-text-to-react

    Weekly Downloads

    1

    Version

    0.2.4

    License

    MIT

    Unpacked Size

    5.16 kB

    Total Files

    9

    Last publish

    Collaborators

    • himenoglyph