Is it possible to get the actual “raw” jsx
text wrapped by a Parent
component (e.g. from props.children
)?
Given this component:
<Parent>
<Child name={'test'} />
</Parent>
question:
In Parent.js
, can I do anything with this.props.children
(or anything else) to get this (ideally as a string):
output:
"<Child name={'test'} />"