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

Cannot read property 'jsPDF' of undefined #3811

Open
Ilyahoncharov opened this issue Jan 17, 2025 · 0 comments
Open

Cannot read property 'jsPDF' of undefined #3811

Ilyahoncharov opened this issue Jan 17, 2025 · 0 comments

Comments

@Ilyahoncharov
Copy link

I'm trying to use jsPDF in a React Native project but I'm getting this error
Cannot read property 'jsPDF' of undefined

code:

...
const generatePDF = ()=>{
    const doc = new jsPDF()
    doc.text('Samle', 20,20)
    doc.save('sample.pdf')
  }
...
<TouchableOpacity
        style={[styles.button, { backgroundColor:'#007BFF' }]}
        onPress={() => {
          generatePDF()
        }}
      >
        <Text style={[styles.buttonText, { color: theme?.buttonTextColor || '#fff' }]}>
          Test
        </Text>
      </TouchableOpacity>

"jspdf": "2.5.2",
"react": "18.2.0",
"react-native": "0.73.6",

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

1 participant