Sha256: 70dded1d34fcc92fed3275c282c365e8b2033beb0062abf4bb532c94b05faa66
Contents?: true
Size: 690 Bytes
Versions: 3
Compression:
Stored size: 690 Bytes
Contents
import React, { useState } from 'react' import { FileUpload, List, ListItem, } from '../..' const AcceptedFilesList = ({files}: FileList) => ( <List> {files.map(file => ( <ListItem key={file.name}>{file.name}</ListItem> ))} </List> ) const FileUploadDefault = () => { const [filesToUpload, setFilesToUpload] = useState([]) const handleOnFilesAccepted = files => { setFilesToUpload([...filesToUpload, ...files]) } return ( <div> <AcceptedFilesList files={filesToUpload} /> <FileUpload acceptedFiles={filesToUpload} onFilesAccepted={handleOnFilesAccepted} /> </div> ) } export default FileUploadDefault
Version data entries
3 entries across 3 versions & 1 rubygems