nwon-html-to-react
v1.1.1
Published
Tools for parsing HTML to React components and sanitizing HML
Downloads
188
Readme
NWON-html-to-react
This packages provides you with a complete tooling for turning HTML into react components. It enables you to define exactly which tags you want to replace with what component.
Main exports
For replacing HTML with react components we expose:
replaceHtmlWithComponent
- A function that takes an HTML string and a map of components to react componentsreplaceEmojis
- A function that replaces emojis in a string with stable counterparts
We also expose the following useful things for sanitizing HTML:
SanitizeHtml
- A component that returns sanitized HTMLuseSanitizedHtml
- A hook that returns sanitized HTMLsanitizeHtml
- A function that returns sanitized HTML