TypeError: this.element.appendChild is not a function #1273
Unanswered
tommy-banana
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi Everyone, hi Diego,
I am new to this so please apologise if I am getting this wrong.
I can successfully display a react component ( inside a wrapper
const MyDocument = () => { return ( <div> <Document> <Page size="A4" style={styles.page}> <View style={styles.section}> <Text>Section1</Text> <ScoreDisplay /> </View> <View style={styles.section}> <Text>Section #2</Text> </View> </Page> </Document> </div> ); };
But if I try and use the Download link option eg:
`const MyDoc = () => {
return (
);
};
const App = () => {
return (
<PDFDownloadLink document={} fileName="somename.pdf" debug = {true}>
{({ blob, url, loading, error }) =>
loading ? 'Loading document...' : 'Download now!'
}
);
};
export default App;`
I get
TypeError: this.element.appendChild is not a function which is thrown by the library creating the component.So it may have nothing to do with react-pdf - it is just strange that it works in the View wrapper. If this error rings any bells with anyone I would appreciate any help.
Best Tommy Banana
Beta Was this translation helpful? Give feedback.
All reactions