Closed
Description
I'm using following replace to get notified when an image is loaded:
replace: function(domNode) {
if(domNode.name === 'img'){
console.log('replacing img', domNode)
return (
<img
{
...domNode.attribs
}
onLoad={() => console.log('image loaded')}
/>
)
}
}
If the image has a style attribute, when i add it back in via the domNode.attribs it throws an error since its not an style object as expected for the jsx img. its still a string. How can I convert the attributes to be jsx ready to passthru in the replace?