Mute the bad words in react component
Stop people from polluting your react application with bad words. Mute the bad words.
This library uses react fragment and thus does not add any DOM node.
$ yarn add react-mute
import Mute from 'react-mute';
// in render
<Mute
safeText="❤️"
addWords=["bad"]
>{"Actual text there bad words are to be muted"}
</Mute>
// => Actual text there ❤️❤️❤️ words are to be muted
type: string
Text that needs to be muted
type: Array
Array of words to mute. These will append to the list of existing list of bad words.
List of words → https://github.com/web-mech/badwords/blob/master/lib/lang.json
type: Array
Array of words to unmute. This will remove words from existing list of bad words.
default: '*'
type: string
Replace these character in muted words.
*** This package is dependent on https://github.com/web-mech/badwords for badwords implementation ***
MIT Copyright (c) 2018-present Ajay Narain Mathur