rn-pdf-reader-js icon indicating copy to clipboard operation
rn-pdf-reader-js copied to clipboard

to fix issue on Android device

Open delonzhou opened this issue 2 years ago • 3 comments

delonzhou avatar Oct 08 '23 10:10 delonzhou

How to get this fix into production? I'm having same issues with the error on Android

GrahamEvans31 avatar Nov 24 '23 04:11 GrahamEvans31

How to get this fix into production? I'm having same issues with the error on Android

try this to resolve:

import PDFReader, { Props } from 'rn-pdf-reader-js'

class MyPDFReader extends PDFReader {
  constructor(props: Props | Readonly<Props>) {
    super(props);
    this.state = { ...this.state, renderedOnce: true };
  }
}

....

return (
   <MyPDFReader 
       source={{ uri: uri }}
       ....
   />
)

MateusArenas avatar Feb 01 '24 17:02 MateusArenas

Hi, will this be merged into master or is there a solution for JS / React Native?

Update: The above fix by extending the class and adding the "renderedOnce" property worked. Thanks.

khanw-hss avatar May 08 '24 23:05 khanw-hss