react-native-pdf-view
react-native-pdf-view copied to clipboard
Setting pageNumber in setNativeProps crashes app (Android Only)
I am setting pageNumber in setNativeProps so that pdf directly opens to that particular page using following code, This works for zoom . iOS works fine and pdf is loaded with 2nd page but crashes the app on Android.
<PDFView ref={(pdf)=>{this.pdfView = pdf;}}
key="sop"
path={this.pdfPath}
onLoadComplete = {(pageCount)=>{
console.log(`total page count: ${pageCount}`);
this.pdfView.setNativeProps({
pageNumber: 2
});
}}
style={styles.pdf}/>
<PDFView ref={(pdf)=>{this.pdfView = pdf;}}
path={this.state.pdfLocation}
onLoadComplete = {(pageCount)=>{
this.pdfView.setNativeProps({
zoom: 1.5
});
}}
pageNumber= {1}
style={styles.pdf}/>