diegomura / diegomura/react-pdf
Forced hyphenation for `{expression}`
- Dominant language
- TypeScript
- Stars
- 16.8k
- Forks
- 1.3k
- Avg merge
- 5h 6m
- Merged PRs (30d)
- 52
Description
**Describe the bug**
The following (with and without the `hyphenationCallback` prop) leads to hyphenation:
```react
[word])}>
This tests that hyphenation doesn't work right in this case and now I need to report it ({word})
```
Result:
While with the word inline, this does not happen.
**To Reproduce**
```React
const word = "somelongword";
const Quixote = () => (
[word])}>
This tests that hyphenation doesn't work right in this case and now I need to report it ({word})
);
const styles = StyleSheet.create({
body: {
paddingTop: 35,
paddingBottom: 65,
paddingHorizontal: 35,
},
text: {
margin: 12,
fontSize: 14,
textAlign: 'justify',
fontFamily: 'Times-Roman'
},
});
ReactPDF.render();
```
**Expected behavior**
No hyphenation is happening, especially with the provided hyphenationCallback. Note that putting the `word` variable inline (`This tests that hyphenation doesn't work right in this case and now I need to report it (somelongword)`) has the correct behaviour.
**Screenshots**
**Desktop (please complete the following information):**
Windows, Chrome, React-PDF REPL 4.1.5
Contributor guide
Assessment
This issue has not been assessed yet.