-
-
Notifications
You must be signed in to change notification settings - Fork 140
Type of parse is any #1313
Copy link
Copy link
Labels
bugSomething isn't workingSomething isn't working
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working