react-safe-html-parser
Version:
A secure, lightweight HTML parser for React with XSS protection and SSR support
13 lines • 666 B
TypeScript
import React from 'react';
import type { ParserOptions, ParseResult } from './types';
/**
* PURE FUNCTION: Parse HTML string into React elements (array)
* Safe for SSR, PDF, and all React renderers. No hooks, no context required.
*/
export declare function parseHtmlToReact(html: string, options?: ParserOptions): ParseResult;
/**
* PURE FUNCTION: Parse HTML string and return a single React element (wrapped in Fragment if multiple)
* Safe for SSR, PDF, and all React renderers. No hooks, no context required.
*/
export declare function parseHtmlToElement(html: string, options?: ParserOptions): React.ReactElement | null;
//# sourceMappingURL=parser.d.ts.map