Load the document and save the PDFProxyDocument object to a local state.
Pass the saved object to the Thumbnail component, which is placed outside of the initial Document and which is not wrapped by another Document component.
Thumbnails are not loading.
Expected behavior
Thumbnails should appear and read the data from the passed PDFProxyDocument object.
Actual behavior
App crashes because of the error Uncaught Error: Invariant failed: Unable to find Document context. Did you wrap <Page /> in <Document />?
Before you start - checklist
Description
I have the components structured like this (just posted the main idea):
I receive an error, even if a pdf exists and is marked as a PDFDocumentProxy.
According to the description, I can provide the object to make it work without wrapping it into another Document layer.
How can it be resolved? What can I do incorrectly?
Click here to find a link to devbox to check by yourself
Thanks!
Steps to reproduce
Expected behavior
Thumbnails should appear and read the data from the passed PDFProxyDocument object.
Actual behavior
App crashes because of the error
Uncaught Error: Invariant failed: Unable to find Document context. Did you wrap <Page /> in <Document />?
Additional information
No response
Environment