Sha256: a8af3d38ebeb647cc019811cbf7f5035d2cf0caa49286e0854cf0857b623b57f
Contents?: true
Size: 767 Bytes
Versions: 1065
Compression:
Stored size: 767 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 FileUploadAccept = (props) => { const [filesToUpload, setFilesToUpload] = useState([]) const handleOnFilesAccepted = (files) => { setFilesToUpload([...filesToUpload, ...files]) } return ( <div> <AcceptedFilesList files={filesToUpload} {...props} /> <FileUpload accept={['image/svg+xml']} onFilesAccepted={handleOnFilesAccepted} {...props} /> </div> ) } export default FileUploadAccept
Version data entries
1,065 entries across 1,065 versions & 2 rubygems