UNPKG

qr-fileshare

Version:

Quickly transfer files to a different device via a web interface

22 lines (17 loc) 428 B
import React, {Component} from 'react'; class FileDownloadForm extends Component { constructor(props) { super(props); this.fileId = props.fileId; } componentWillUpdate(nextProps) { this.fileId = nextProps.fileId; } render() { let url = `/api/file/${this.fileId}`; return ( <a href={url} download id="fileDownloadLink"/> ) } } export default FileDownloadForm;