# @feizheng/react-upload

> Upload component for react.

Latest version **1.0.0** (published 2020-02-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install @feizheng/react-upload
pnpm add @feizheng/react-upload
yarn add @feizheng/react-upload
bun add @feizheng/react-upload
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2020-02-17 |
| First published | 2020-02-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 9.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | afei |
| Maintainers | afeiship |
| Keywords | react, component |

## Links

- npm: https://www.npmjs.com/package/@feizheng/react-upload
- Repository: https://github.com/afeiship/react-upload
- Homepage: https://github.com/afeiship/react-upload#readme
- Issues: https://github.com/afeiship/react-upload/issues
- npm.io page: https://npm.io/package/@feizheng/react-upload

## Dependencies (4)

- [classnames](https://npm.io/package/classnames.md) ^2.2.6
- [prop-types](https://npm.io/package/prop-types.md) ^15.7.2
- [@feizheng/noop](https://npm.io/package/@feizheng/noop.md) ^1.0.0
- [@feizheng/next-file-to-base64](https://npm.io/package/@feizheng/next-file-to-base64.md) ^1.1.1

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2020-02-17

## README

# react-upload
> Upload component for react.

## installation
```shell
npm install -S @feizheng/react-upload
```

## update
```shell
npm update @feizheng/react-upload
```

## properties
| Name      | Type   | Default | Description                           |
| --------- | ------ | ------- | ------------------------------------- |
| className | string | -       | The extended className for component. |
| name      | string | 'file'  | Name for upload.                      |
| multiple  | bool   | false   | If is multiple.                       |
| max       | number | 10      | Max size files.                       |
| onChange  | func   | noop    | The change handler.                   |
| accept    | string | -       | Accept types.                         |


## usage
1. import css
  ```scss
  @import "~@feizheng/react-upload/dist/style.scss";

  // customize your styles:
  $react-upload-options: ()
  ```
2. import js
  ```js
  import ReactUpload from '@feizheng/react-upload';
  import ReactDOM from 'react-dom';
  import React from 'react';
  import './assets/style.scss';

  class App extends React.Component {
    state = {
      dataURLs: []
    };

    handleChange = (e) => {
      this.setState({
        dataURLs: e.target.dataURLs
      });
    };

    render() {
      const { dataURLs } = this.state;
      return (
        <div className="app-container">
          <ReactUpload max={3} multiple={true} onChange={this.handleChange} />
          <div className="pic-list">
            {dataURLs.map((item, index) => {
              return <img key={index} src={item} />;
            })}
          </div>
        </div>
      );
    }
  }

  ReactDOM.render(<App />, document.getElementById('app'));

  ```

## documentation
- https://afeiship.github.io/react-upload/

---
_Source: https://npm.io/package/@feizheng/react-upload · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
