File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -7,10 +7,10 @@ var domParserOptions = { decodeEntities: true, lowerCaseAttributeNames: false };
77/**
88 * Converts HTML string to React elements.
99 *
10- * @param {String } html - The HTML string to parse to React.
11- * @param {Object } [options] - The parser options.
12- * @param {Function } [options.replace] - The replace method.
13- * @return {ReactElement|Array |String } - When parsed with HTML string, returns React elements; otherwise, returns string or empty array.
10+ * @param {String } html - The HTML string to parse to React.
11+ * @param {Object } [options] - The parser options.
12+ * @param {Function } [options.replace] - The replace method.
13+ * @return {JSX.Element|JSX.Element[] |String } - Returns React element(s), string, or empty array.
1414 */
1515function HTMLReactParser ( html , options ) {
1616 if ( typeof html !== 'string' ) {
@@ -22,5 +22,6 @@ function HTMLReactParser(html, options) {
2222HTMLReactParser . domToReact = domToReact ;
2323HTMLReactParser . htmlToDOM = htmlToDOM ;
2424
25+ // support CommonJS and ES Modules
2526module . exports = HTMLReactParser ;
2627module . exports . default = HTMLReactParser ;
You can’t perform that action at this time.
0 commit comments