@jhoncbernal wrote:
I had problems with react in ionic to use de File transfer someone can help me?
import { FileTransfer, FileUploadOptions, FileTransferObject } from ‘@ionic-native/file-transfer’;
export class FileFormPage extends React.Component<{},
{ http:HTTP,
file: any,
showToast1: boolean,
loginMessage: string,
hiddenbar: boolean,
}> {
constructor(props: any,private http: HTTP,private transfer: FileTransfer) {
super(props);
this.state = {
http:http,
file: ‘’,
showToast1: false,
loginMessage: ‘’,
hiddenbar: true,
}
}
async handleSubmit(e: FormEvent) {
e.preventDefault();
try {
const fileTransfer: FileTransferObject = this.transfer.create(); “Cannot read property ‘create’ of undefined”
or if i change the importTypeScript error in /Users/jhoncasallas/Documents/OwnCode/VecinoIonic/src/components/FileForm.tsx(22,69):
Cannot find module ‘@ionic-native/file-transfer/ngx’. TS2307
20 | import { execFile } from ‘child_process’;
21 | import { File } from ‘@ionic-native/file’;22 | import { FileTransfer, FileUploadOptions, FileTransferObject } from ‘@ionic-native/file-transfer/ngx’
Posts: 1
Participants: 1