Relates to #43. I'm looking to access the raw HTML of a table inside a custom renderer. The renderer is set up, but I want to find a good way to extract the relevant html.
Looking at the parameters, htmlAttribs and convertedCSSStyles are empty objects as expected, while passProps.html is the entire html document.
Children is the subchildren I'm looking for, but is already pre-processed into react native elements.
Is there a way to get the raw html contained by the rendered tag at this stage in the rendering process?
Did you solve it?
No, it appears that by that point, the html is already gone, converted into elements structures.
Came up with a more "react native" solution to my problem, see #43 for details
We are experiencing the same problem - is there a PR for this already?
No, sorry, I think it's simply not supported. If you look at the problem you're trying to solve at a higher level, you can do quite a lot with "alterData", "alterChildren", "render", and "onParsed", thoguh.
The expectation is that children contains something - it looks like that is fixable.
Children does contain something though, it contains the rendered React-Native ready elements, just not XML.
I'm not sure what's your need, but node.children holds child nodes as htmlparser2 objects at: "alterNode", "alterData", "alterChildren" callbacks
It is possible to get the actual HTML string in custom renderers so we could use that in a WebView?
@abhimanyuPathania : Have you find way to get html of specific node in custom renderer?
@jariwalabhavesh No. I ended up not using this package because of that.
This feature has been available since the v5 release. Just use domNodeToHTMLString exported utility over 'domNode(inpassProps`).
Most helpful comment
It is possible to get the actual HTML string in custom renderers so we could use that in a
WebView?