Hast Util To Jsx Runtime
hast-util-to-jsx-runtime
hast utility to transform to preact, react, solid, svelte, vue, etc
Utilities
hast-util
hast
html
preact
react
solid
svelte
unist
utility
util
Stars
90
Weekly
26M
Open issues
1
Bundle
~15 kB
Installation
npm install hast-util-to-jsx-runtimeCode example
import { useHastUtilToJsxRuntime } from "hast-util-to-jsx-runtime";
export function Example() {
const value = useHastUtilToJsxRuntime();
return <p>{String(value)}</p>;
}Pros & cons
Pros
- Actively maintained by Titus Wormer
- 26M weekly downloads. Battle tested
- First-class TypeScript definitions
- MIT licensed
Considerations
- Adds roughly ~15 kB to your bundle
- Needs client-only rendering in SSR frameworks
- Not supported in React Native
- 1 open issues on GitHub