react-downloader-file

React download file

Usage no npm install needed!

<script type="module">
  import reactDownloaderFile from 'https://cdn.skypack.dev/react-downloader-file';
</script>

README

react-downloader-file

react file stream download

Install

$ yarn add react-downloader-file
$ npm install react-downloader-file

Example

import React from 'react';
import DownLoadFile,{DownloadFileProps} from 'react-downloader-file';

const ExampleComponent:React.FC<DownloadFileProps> = props =>{
    return (
        <DownLoadFile
            url="/user/info"
            headerParams={{
                method:'POST',
                credentials:'include',
            }}
        >
         <Button>下载</Button>
        </DownLoadFile>
   )
}
export default ExampleComponent;

License

react-downloader-file available under the MIT License

Keywords

react fetch