Buckets:
| import React from "react"; | |
| import Dropzone from "../../"; | |
| import { FileWithPath } from "file-selector"; | |
| export default class Basic extends React.Component { | |
| state = { files: [] }; | |
| onDrop = (files: FileWithPath[]) => { | |
| this.setState({ | |
| files, | |
| }); | |
| }; | |
| render() { | |
| return ( | |
| <section> | |
| <div className="dropzone"> | |
| <Dropzone onDrop={this.onDrop}> | |
| {({ getRootProps, getInputProps }) => ( | |
| <div {...getRootProps()}> | |
| <input {...getInputProps()} /> | |
| <p> | |
| Try dropping some files here, or click to select files to | |
| upload. | |
| </p> | |
| </div> | |
| )} | |
| </Dropzone> | |
| </div> | |
| <aside> | |
| <h2>Dropped files</h2> | |
| <ul> | |
| {this.state.files.map((f) => ( | |
| <li key={f.name}> | |
| {f.name} - {f.size} bytes | |
| </li> | |
| ))} | |
| </ul> | |
| </aside> | |
| </section> | |
| ); | |
| } | |
| } | |
| export const optional = ( | |
| <Dropzone> | |
| {({ getRootProps, getInputProps }) => ( | |
| <div {...getRootProps()}> | |
| <input {...getInputProps()} /> | |
| </div> | |
| )} | |
| </Dropzone> | |
| ); | |
Xet Storage Details
- Size:
- 1.22 kB
- Xet hash:
- 900ee363fbad2e0eea222915dc0d1f436df163ebe45f0aa0d43378622918a08b
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.