-
-
Notifications
You must be signed in to change notification settings - Fork 139
Export domToReact in public API #84
Copy link
Copy link
Closed
Labels
featureNew feature or requestNew feature or request
Description
Right now, if I use the replace option to substitute certain DOM nodes with React elements, there's no good way to keep the children of that node (to pass as children to the React element) – because the React element will expect React element children, not the DOM node objects. So the current options are:
- Turn the children back into HTML somehow and run them back through the parser in my
replacefunction (wasteful). - Reach into
html-react-parser/lib/dom-to-reactmodule myself (undocumented, private API).
A nicer option would be to either export domToReact from the main entry point, or instead of throwing on non-string inputs, assume it is already a parsed DOM tree, so you can simply do parser(node.children).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
featureNew feature or requestNew feature or request