danomatic / react-pdf-html

Render HTML in react-pdf
MIT License
167 stars 40 forks source link

how pass react-pdf attributtes to the components #61

Closed JuanDiegoGV closed 8 months ago

JuanDiegoGV commented 1 year ago

Hi, first thank you for create this package. I read how work the package and if i understand, this package converts html tags like and

to the react-pdf component . My question is how to pass the react-pdf attributes directly to the converted component, for example: I want to pass hyphenationCallback attribute to all the components that the package returns.

danomatic commented 8 months ago

Hi @JuanDiegoGV. Thank you for your question. Because this package only converts html strings to react-pdf components, it doesn't have a full react-dom setup with jsx attributes. In theory, someone could create a react-pdf-dom type of package that directly converts from react-dom JSX to react-pdf and passes along callback attributes, but I haven't taken that on at this time and it doesn't seem as useful because react-pdf can already be written in JSX.