Closed samuliasmala closed 1 year ago
Please don't inline options prop value, or memoize it if you absolutely have to specify it inside render function. It's likely your error will be gone. Refer to official documentation and samples for examples.
Yes, defining the options prop outside of the render function indeed fixed the problem! Thanks. Maybe the documentation should be updated that it's not just a performance reason to define the options object outside of the React component but it's actually mandatory for it to work?
I've recently made it clearer to guide people on the right track, but perhaps it could be even better indeed. Glad it resolved your problem though.
Before you start - checklist
Description
In version 7.0.3
verbosity
was added tooptions
prop inDocument
component. However adding that option will throw an error.Steps to reproduce
Use
verbosity
option inDocument
options
:Expected behavior
The document is displayed.
Actual behavior
I get TypeError: Cannot perform Construct on a detached ArrayBuffer error:
Additional information
If the
options={{ verbosity: pdfjs.VerbosityLevel.ERRORS }}
is removed everything works nicely.Environment