react-string-manipulator

1.0.12 • Public • Published

react-string-manipulator

NPM JavaScript Style Guide

Install

npm install --save react-string-manipulator

Usage

import React, { Fragment } from 'react'
import Jaril from 'react-string-manipulator'
 
const App = () => (
  <Fragment>
    <Jaril
      text='Hello World, How are me today?'
      findAndReplace={{
        findText: 'me',
        replaceText: 'you'
      }}
    />
    <Jaril
      text='Hello World, How are you today?'
      tagName={{
        tag: 'b',
        string: 'World'
      }}
    />
  </Fragment>
)
 
export default App

Usage of Hooks

import React, { useState } from 'react'
import { useManipulator } from 'react-string-manipulator'
 
const App = () => {
  const [heading, setHeading] = useState(
    useManipulator({
      text: 'Hello World',
      search: 'World',
      tag: 'b'
    })
  )
  return <div dangerouslySetInnerHTML={{ __html: heading.renderString }} />
}
 
export default App

License

MIT © jaril5976

Package Sidebar

Install

npm i react-string-manipulator

Weekly Downloads

0

Version

1.0.12

License

MIT

Unpacked Size

11.9 kB

Total Files

6

Last publish

Collaborators

  • jaril5976
  • yash2906