Closed
Description
Expected Behavior
The parse
function exported from html-react-parser
should have a proper type.
Actual Behavior
Since 5.1.4 the type is any, which basically turns off type checking for the parameters and any processing that happens on the returned value. This used to work in previous versions.
Steps to Reproduce
import parse, { Element } from "html-react-parser";
const html = ...;
const parsed = parse(html, {
// ^ parse has type any now
replace(domNode) {
// ^ This type was correctly inferred in previous versions
...
},
});
Reproducible Demo
Environment
- Version: 5.1.4
Keywords
types, #1305