You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello In my application when user press save on their form section it makes an server action to update the server side which then calls revalidatePath to the page where my PDFViewer is.
My problem here is that when PDF get re-rendered there is a little flicker that shows "loading PDF..." This is not an functionality i'm aiming for. What i would want is to have somewhat replication from React-pdf/repl https://react-pdf.org/repl
So how do i can get rid of the flicker and instead have the PDF showing there constantly, and then showing the re-rendered pdf to have a preview like PDFViewer.
Sorry for the long code snippet, but it's all related to the issue I'm facing.
Edit: Code is now edited to working code. Only issue i get now that sometimes i Have Error Warning: Encountered two children with the same key, blob:http://localhost:3000/123. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.
I think one big thing that was the problem was the way how i was importing the pdfjs. Now after importing it the way i have now in code, it made the pdf transition alot faster.
div
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello In my application when user press save on their form section it makes an server action to update the server side which then calls revalidatePath to the page where my PDFViewer is.
My problem here is that when PDF get re-rendered there is a little flicker that shows "loading PDF..." This is not an functionality i'm aiming for. What i would want is to have somewhat replication from React-pdf/repl https://react-pdf.org/repl
So how do i can get rid of the flicker and instead have the PDF showing there constantly, and then showing the re-rendered pdf to have a preview like PDFViewer.
Provided video to demostrate the problem:
Screencast from 12.08.2024 15.15.01.webm
Here is code that i'm currently using:
Sorry for the long code snippet, but it's all related to the issue I'm facing.
Edit: Code is now edited to working code. Only issue i get now that sometimes i Have Error
Warning: Encountered two children with the same key,
blob:http://localhost:3000/123. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.I think one big thing that was the problem was the way how i was importing the pdfjs. Now after importing it the way i have now in code, it made the pdf transition alot faster.
div
PDFViewer.tsx:
How the PDFViewer is used:
Beta Was this translation helpful? Give feedback.
All reactions