react-string-manipulator
v1.0.12
Published
Made with create-react-library
Downloads
4
Readme
react-string-manipulator
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