An open API service indexing awesome lists of open source software.

https://github.com/cometkim/react-directory-input

A simple component to handle a directory as a single file
https://github.com/cometkim/react-directory-input

Last synced: 7 months ago
JSON representation

A simple component to handle a directory as a single file

Awesome Lists containing this project

README

          

# react-directory-input

A simple component to handle a directory as a single file

## Example

```tsx
import * as React from 'react';
import { ReactDirectoryZipInput } from 'react-directory-input';

function DirectoryUpload() {
const [isProcessing, setIsProcessing] = React.useState(false);
const [upload, setUpload] = React.useState(null);
return (
{
setIsProcessing(true);
}}
onArchivingResult={({ result }) => {
setUpload(result);
setIsProcessing(false);
}}
/>
);
}
```

## Note about using form

There is no way to manipulate state of file input from JavaScript for security reason, which is I didn't noticed when implementing it.

When to try using form, **you should override default form submit handler** to build your own FormData, or it is always empty file value.

## LICENSE

MIT