sunknudsen / react-node-to-string

Extract string from React node.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-node-to-string

Extract string from React node.

This project was developed to extract string from React.ReactNode object.

Installation

$ npm install react-node-to-string --save

Usage

import { ReactNode } from "react"
import reactNodeToString from "react-node-to-string"

const node: ReactNode = (
  <p>
    <strong>lorem</strong>ipsum
  </p>
)

console.log(reactNodeToString(node))

// loremipsum

Licence

MIT

About

Extract string from React node.

License:MIT License


Languages

Language:TypeScript 100.0%