Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object entries requires that input parameter not be null or undefined #196

Open
aasuparekh1 opened this issue Sep 15, 2023 · 4 comments
Open

Comments

@aasuparekh1
Copy link

Issue Description

Error: Object.entries requires that input parameter not be null or undefined

Steps to Reproduce / Code Snippets

import React from 'react'
import { StyleSheet, View, Text,Dimensions } from 'react-native'
import PDFReader from 'rn-pdf-reader-js'

export default class App extends React.Component {
render() {
return (

<PDFReader
source={{
uri: 'https://pmkusum.hareda.gov.in/Site Survey Form.pdf',
}}
webviewProps={{
startInLoadingState: true,
}}
/>

)
}
}

const styles = StyleSheet.create({
container: {
paddingTop: 30,
flex: 1,
},
imageContainer: {
flex: 1,
width: Dimensions.get("window").width,
height: Dimensions.get("window").height,
},
})

Expected Results

open pdf in pdf viewer

Additional Information

  • Nodejs version: v18.17.0
  • React version: 0.72.4
  • expo version: 49.0.10
  • rn-pdf-reader-js version: ^4.1.1
  • react-native-webview: ^13.6.0
  • Platform(s) (iOS, Android, or both?): Android
@mhstrkmp
Copy link

Had the same issue after upgrading to expo SDK49. I am not sure if this is the best approach, but after downgrading react-native-webview in my case back to 11.23.1 it works again. However, it is not the recommended version by expo.

@dev-jaydeep
Copy link

Checkout the comment to make it resolve.

#195 (comment)

@WuZhiChun
Copy link

Had the same issue after upgrading to expo SDK49. I am not sure if this is the best approach, but after downgrading react-native-webview in my case back to 11.23.1 it works again. However, it is not the recommended version by expo.

但是在IOS ,不行

@MateusArenas
Copy link

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 }}
       ....
   />
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants