Create the canvas on every render of the PDF in order to avoid issues with concurrent rendering on the same canvas. This is e.g. suggested in the following comment in pdfjs project:
Create the canvas on every render of the PDF in order to avoid issues
with concurrent rendering on the same canvas. This is e.g. suggested in
the following comment in pdfjs project:

https://github.com/mozilla/pdf.js/issues/2923#issuecomment-14715851

mikecousins/react-pdf-js,mikecousins/react-pdf-js,mikecousins/react-pdf-js