UNPKG

react-intlayer

Version:

Easily internationalize i18n your React applications with type-safe multilingual content management.

1 lines 850 B
{"version":3,"file":"HTMLRendererPlugin.cjs","names":["renderHTML","useHTMLContext"],"sources":["../../../src/html/HTMLRendererPlugin.tsx"],"sourcesContent":["import type { FC, ReactNode } from 'react';\nimport { useHTMLContext } from './HTMLProvider';\nimport { renderHTML } from './HTMLRenderer';\n\ntype HTMLRendererPluginProps = {\n html: string;\n userComponents?: Record<string, any>;\n};\n\nexport const HTMLRendererPlugin: FC<HTMLRendererPluginProps> = (\n props\n): ReactNode => {\n const { html, userComponents } = props;\n const context = useHTMLContext();\n\n return renderHTML(html, {\n components: {\n ...context?.components,\n ...userComponents,\n },\n });\n};\n"],"mappings":";;;;;AASA,MAAa,sBACX,UACc;CACd,MAAM,EAAE,MAAM,mBAAmB;AAGjC,QAAOA,qCAAW,MAAM,EACtB,YAAY;EACV,GAJYC,0CAIF,EAAE;EACZ,GAAG;EACJ,EACF,CAAC"}