Nested <Text>'s with a render function don't render
Describe the bug
https://react-pdf.org/components#text states that
Text supports nesting of other Text or Link components to create inline styling.
but nesting Text with a render function does not render the text at all.
This worked in 3.x previously, if that helps.
To Reproduce
const Test = () => (
<Document>
<Page>
<Text>
<Text render={() => <Text>This does not render</Text>} />
</Text>
<Text>
<Text render={() => "This does not render"} />
</Text>
<Text render={() => <Text>This does render</Text>} />
<View>
<Text render={() => <Text>This does render</Text>} />
</View>
</Page>
</Document>
);
ReactPDF.render(<Test />);
Expected behavior Nested Texts are expected to render when using a render function.
Likely related: https://github.com/diegomura/react-pdf/issues/3083 https://github.com/diegomura/react-pdf/issues/2988 https://github.com/diegomura/react-pdf/issues/3044
Why do we want to nest Texts in the first place?
We have textboxes with arbitrary content which can also be variables that are interpolated on generation. Within a Textblock there should be flow and one of the variables is pageNumber, where we need to use a render function to get the number. Now a pageNumber can be within a paragraph which should be a <Text> element to enable inline flowing.
Probably related: https://github.com/diegomura/react-pdf/issues/2258