react-html-parser
react-html-parser copied to clipboard
how to handle with React.createElement ?
hi I use transform and i dont get the value from html tag like.
const options = {
transform: (node, index) => {
if (node.name == "button") {
return React.createElement(
Button,
null,
???? <-- how to insert value to this
)
}
}
}
I'm not 100% sure what you want to do but I'm guessing you want to add all children to this tag:
const children = processNodes(node.children, transform);
return React.createElement(Button, null, children);