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
When using a lineHeight style, any <Text /> node with a render={...} will fail to render its content.
To Reproduce
Consider the following code:
constTest=()=>(<Document><Pagestyle={styles.body}><Textrender={()=>'This does not render'}/><Text>Butthisdoes</Text><Text>Torendereverything,removethe"lineHeight"stylebelow</Text></Page></Document>);conststyles=StyleSheet.create({body: {lineHeight: '100%'}});ReactPDF.render(<Test/>);
Describe the bug
When using a
lineHeight
style, any<Text />
node with arender={...}
will fail to render its content.To Reproduce
Consider the following code:
REPL reproduction: https://react-pdf.org/repl?code=3187b0760ce02e00402a05368c0bc30050129503e0c0a061801e0044460057016c130a1d0a24801404301cc119a013c01b04280379f411001d002310004d7805f46cd9b144003d600273ab2116915970c00e470005804b08316482430c086dbbf49853003d32952434300214a58282b1b3b24624f7f1f1535044d1c3810181d303d2d180400377d5e50cb300e001a54846a105c9850ee00227e42840009044b0e73285a9e28016e29047e1000772898a62228f62e1f28f22a5a7a464c006e7c7c50485831073400651ec15df304042809601d3628047461261979002e183b9506b066d6f6a867930046000300200a42626029f00a159ac004a0836300a02c52000c424690cba1e2c86f342800000
Rolling back to
@react-pdf/layout@4.1.1
(as per #2988 (comment)) also fixes the problem.Expected behavior
The "This does not render" text should render, but it doesn't. This bug might be related to #2988.
Screenshots
Kapture.2025-02-17.at.21.11.28.mp4
Desktop (please complete the following information):
@react-pdf/renderer@4.2.2
The text was updated successfully, but these errors were encountered: