0.1.2 • Published 8 months ago

react-node-to-string v0.1.2

Weekly downloads
6
License
MIT
Repository
github
Last release
8 months ago

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