diegomura / diegomura/react-pdf
Word break with numeric sequence is ignored by react-pdf rendering
- Dominant language
- TypeScript
- Stars
- 16.8k
- Forks
- 1.3k
- Avg merge
- 5h 6m
- Merged PRs (30d)
- 52
Description
**Describe the bug**
I using the same component with the same styling, but when I use letters `[a-zA-Z]` it respects the break line due to lack of space, but when I use numbers [0-1] it does not respect the width of `View`
**To Reproduce**
****
1. Create component and render
```tsx
const styles = StyleSheet.create({
body: {
paddingTop: 35,
paddingBottom: 65,
paddingHorizontal: 35,
},
textContainer: {
width: 200,
height: 100,
border: '1px solid red'
},
container: {
flex: 1,
display: 'flex',
gap: 10
}
});
const MyDocument = () => (
TestingTestingTestingTestingTestingTestingTestingTestingTesting
10101010101010101010101010101010101010
);
// To render the document
ReactPDF.render();
```
[Snippet of code](https://react-pdf.org/repl?code=3187b0760ce02e004d09e01b02984605e18194a4e5600b6592803a6002764043299002806f00a06366008c4004de00b860b76c2600076addb804b3001cc00a88510203300560034ac45b719266c804220a1410016c040364dda75ee972004880a52017b828d512adbc2017cb584e8003ca00184bda8659028051860ec4401dca5b8a008040098001972349274d888a56408a0040119f30b9384b829b8e20401c8ab4542e04111d260a9b95a8bd8839340c1bd63e305867400cc5143aaeb8a61a4214511a9f8615a1791435a578b65a994606b6660039802012801b99999c7a0600165e000444180015dccc80986060f43b860007ca0e4800787eff4044c21f5760c2000ad459320e0b8143a1180814041485c5e00591ab610c2006a52640a471787c61350e46894dc928ca4c06974864b399b8d658522ecb01c539dcee4c3e4072804365d00322aa0cad42aae42ab552b35eaed46a147add4eb6430803d2cbc214a9552cdb4fa75a6d6c5e7d319788250b8922a884c62e28a24a9d3a195ca213570ee42351c8cc7a371d8ee5cd96f957329e6fb4a51d69bb5f2b3b68c562b3e6f84028129c7b3d9866b34c114fd2073428304cb63b8bf52c4d9800251a300a068af800c5485430237e830cf89711b0334431e400)
**Expected behavior**
I hope that the `word-break` of the `View` width spacing is respected, as happens when I use letters instead of numbers.
Is there any way around this?
**Screenshots**


**Example in CSS3**
> In `CSS3` exist the property `word-break` to workaround this behavior

**Desktop**
- OS: Ubuntu 22.04.5 LTS
- Browser: chrome
- React-pdf version: v4.1.6
Contributor guide
Assessment
This issue has not been assessed yet.