react-pdf icon indicating copy to clipboard operation
react-pdf copied to clipboard

Non-deterministic `Document` IDs on subsequent renders

Open markusylisiurunen opened this issue 1 year ago • 0 comments

Describe the bug I encountered an issue with non-deterministic document IDs when trying to write a few snapshot test cases for a project I was working on. I tried setting every prop for both <Document /> (incl. creationDate and modificationDate) and <Page />. The document's ID is still different on every render.

To Reproduce Try to render any document twice with any content and compare the raw outputs. You will find that the /ID line (e.g. /ID [<a072362df31f6eb25904f2f2fc2166d8> <a072362df31f6eb25904f2f2fc2166d8>]) differs on subsequent renders.

Expected behavior I would expect the ID to stay the same given the same props.

Desktop:

  • OS: macOS
  • react-pdf version: 3.4.4

markusylisiurunen avatar Jul 10 '24 14:07 markusylisiurunen