Sha256: a2c9832a1612eb2ebbc3431633a6ca095846266616b6e594ede5556d05dc7f32
Contents?: true
Size: 669 Bytes
Versions: 157
Compression:
Stored size: 669 Bytes
Contents
/* @flow */ 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 onFilesAccepted={handleOnFilesAccepted} /> </div> ) } export default FileUploadDefault
Version data entries
157 entries across 157 versions & 1 rubygems