File tree 1 file changed +5
-4
lines changed
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 };
7
7
/**
8
8
* Converts HTML string to React elements.
9
9
*
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.
14
14
*/
15
15
function HTMLReactParser ( html , options ) {
16
16
if ( typeof html !== 'string' ) {
@@ -22,5 +22,6 @@ function HTMLReactParser(html, options) {
22
22
HTMLReactParser . domToReact = domToReact ;
23
23
HTMLReactParser . htmlToDOM = htmlToDOM ;
24
24
25
+ // support CommonJS and ES Modules
25
26
module . exports = HTMLReactParser ;
26
27
module . exports . default = HTMLReactParser ;
You can’t perform that action at this time.
0 commit comments