You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 />);
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.
The text was updated successfully, but these errors were encountered:
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
react-pdf REPL to reproduce
Expected behavior
Nested Texts are expected to render when using a render function.
Likely related:
#3083
#2988
#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 apageNumber
can be within a paragraph which should be a<Text>
element to enable inline flowing.The text was updated successfully, but these errors were encountered: