react-pdf: Wrap won't work when text is higher than the page

Hello,

I found out that if a <Text> is wrapped in a <View>, then if the text is taller than the page, we run into an infinite loop calculation making the browser stucked and need to force quit.

Here is the sample, just copy paste the lorem ipsum until it overlap the page !

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15 (6 by maintainers)

Most upvoted comments

I use an IDE which allow me to debug with a debugger (I’m not a big fan of console.log ^^) but it need to breakpoint to meaningful lines. Anyway, meantime I actually started with console.log and the build:watch for auto compilation, and I found out some preliminary things :

  • In the Base.js file in the function fillRemainingSpace if the element is a View (containing long text), then canBeSplitted is false, but if it’s a Text (containing long text), then canBeSplitted is true. So when it’s a view, there is an infinite loop in the recalculateLayout() ! I’m checking if I can fix it. capture d ecran 2018-06-21 a 14 51 49