DanielArnould / react-pdf-highlighter-extended

📄 Set of modern React components for PDF highlighting
https://danielarnould.github.io/react-pdf-highlighter-extended/example-app/
MIT License
43 stars 16 forks source link

Better content typing #16

Closed DanielArnould closed 1 month ago

DanielArnould commented 1 month ago

Since content isn't actually needed for anything in the PdfHighlighter, it should be removed from the Highlight type. As stated in #5 , for large numbers of highlights, especially images, this can be beneficial for performance and storage since image content no longer needs to be loaded on every render or stored in a database if not required.

Since developers might already be using content to determine whether a highlight is an area highlight or text highlight, we simply add a new type property that makes this explicit. However, to avoid any breaking changes, type has been marked as optional and content is kept in Highlight but made optional.