parallax/jsPDF

Cannot read property 'jsPDF' of undefined

Closed this issue · 1 comments

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",

This issue is stale because it has been open 90 days with no activity. It will be closed soon. Please comment/reopen if this issue is still relevant.