Example doesn't work on react-native v0.21
See original GitHub issueI’m getting undefined is not an object (evaluating 'RNHTMLtoPDF.convert')
error from this line: RNHTMLtoPDF.convert(options).then((result) => {
here is my code:
'use strict';
var React = require('react-native');
var {
AlertIOS,
AppRegistry,
NativeModules: {
RNHTMLtoPDF,
RNMail
},
StyleSheet,
Text,
TouchableHighlight,
View,
} = React;
import template from '../helpers/template';
var HTMLToPDFExample = React.createClass({
componentDidMount() {
var options = {
html: template.html,
fileName: 'test',
directory: 'docs',
height: 800,
width: 1056,
padding: 24,
};
RNHTMLtoPDF.convert(options).then((result) => {
RNMail.mail({
subject: 'Test',
recipients: [''],
body: '',
attachmentPath: result,
attachmentType: 'pdf',
}, (error, event) => {
if(error) {
AlertIOS.alert('Error', 'Could not send mail. Please send a mail to support@example.com');
}
});
});
},
.....
.....
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Troubleshooting - React Native
If you added React Native manually to your project, make sure you have included all the relevant dependencies that you are using, like...
Read more >Could not connect to React Native development server on ...
Open your React Native app on your device. You'll see a red screen with an error. This is OK. The following steps will...
Read more >react-native - npm
A framework for building native apps using React. Latest version: 0.70.6, last published: a month ago. Start using react-native in your ...
Read more >React Native v0.63.x released
Update react-native-community/eslint-config to 1.1. · Update community eslint plugin in the eslint config (b2d10bc602 by @Naturalclar) · Upgrade ...
Read more >React Native Tutorial for Beginners - YouTube
React Native Tutorial for Beginners - Learn to build an amazing React Native app for iOS & Android. Get the full...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@christopherdro thanks! I haven’t tried it yet. I will and let you know. Thank you again.
did you solve that problem?!!