Skip to content

Commit 68e4d6d

Browse files
committed
Release 2.3.4
1 parent 921ce4b commit 68e4d6d

File tree

2 files changed

+42
-36
lines changed

2 files changed

+42
-36
lines changed

README.md

Lines changed: 41 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
<h1 align="center">
4545
Quick Start —
46-
<a href="https://codepen.io/upload-js/pen/popWJpX?editors=1010">
46+
<a href="https://codepen.io/upload-js/pen/popWJpX?editors=0010">
4747
Try on CodePen
4848
</a>
4949
</h1>
@@ -96,39 +96,35 @@ Or via a `<script>` tag:
9696
<script src="https://js.upload.io/react-uploader/v2"></script>
9797
```
9898

99-
# Usage
100-
101-
Initialize once at the start of your application:
102-
103-
```javascript
104-
import { Uploader } from "uploader";
105-
106-
// Get production API keys from Upload.io
107-
const uploader = Uploader({
108-
apiKey: "free"
109-
});
110-
```
111-
112-
Then choose a UI component:
113-
114-
## `UploadButton`
99+
## UploadButton — [Try on CodePen](https://codepen.io/upload-js/pen/popWJpX?editors=0010)
115100

116101
The `UploadButton` component uses a [render prop](https://reactjs.org/docs/render-props.html) to provide an `onClick` callback to your button element.
117102

118103
When clicked, a file upload modal will appear:
119104

120105
```javascript
106+
import { Uploader } from "uploader"; // Installed by "react-uploader".
121107
import { UploadButton } from "react-uploader";
122108

123-
<UploadButton uploader={uploader}
124-
options={{multi: true}}
125-
onComplete={files => console.log(files)}>
126-
{({onClick}) =>
127-
<button onClick={onClick}>
128-
Upload a file...
129-
</button>
130-
}
131-
</UploadButton>
109+
// Initialize once (at the start of your app).
110+
const uploader = Uploader({
111+
apiKey: "free" // Get production API keys from Upload.io
112+
});
113+
114+
// Configuration options: https://upload.io/uploader#customize
115+
const options = { multi: true };
116+
117+
const MyApp = () => (
118+
<UploadButton uploader={uploader}
119+
options={options}
120+
onComplete={files => alert(files.map(x => x.fileUrl).join("\n"))}>
121+
{({onClick}) =>
122+
<button onClick={onClick}>
123+
Upload a file...
124+
</button>
125+
}
126+
</UploadButton>
127+
);
132128
```
133129

134130
Required props:
@@ -139,20 +135,30 @@ Optional props:
139135
- `options`
140136
- `onComplete`
141137

142-
## `UploadDropzone`
138+
## UploadDropzone[Try on CodePen](https://codepen.io/upload-js/pen/LYrMzaB?editors=0010)
143139

144140
The `UploadDropzone` component renders an inline drag-and-drop file upload dropzone:
145141

146142
```javascript
147-
import { UploadDropzone } from "react-uploader";
143+
import { Uploader } from "uploader"; // Installed by "react-uploader".
144+
import { UploadButton } from "react-uploader";
148145

149-
<UploadDropzone uploader={uploader}
150-
options={{multi: true}}
151-
onUpdate={files => console.log(files)}
152-
width="600px"
153-
height="375px" />
154-
```
146+
// Initialize once (at the start of your app).
147+
const uploader = Uploader({
148+
apiKey: "free" // Get production API keys from Upload.io
149+
});
150+
151+
// Configuration options: https://upload.io/uploader#customize
152+
const options = { multi: true };
155153

154+
const MyApp = () => (
155+
<UploadDropzone uploader={uploader}
156+
options={options}
157+
onUpdate={files => alert(files.map(x => x.fileUrl).join("\n"))}
158+
width="600px"
159+
height="375px" />
160+
);
161+
```
156162

157163
Required props:
158164
- `uploader`
@@ -214,7 +220,7 @@ Upload.io benefits developers with:
214220

215221
### 🔧 Can I bring my own file storage?
216222

217-
Uploader's USP is to provide the fastest way to integrate end-to-end file uploads into a web app, while remaining customizable. As such, Uploader will always be closely integrated with the Upload.io platform, and there are currently no plans to support custom backends. You may, however, sync files from your Upload.io account to a custom storage target.
223+
**Yes!** [Upload.io](https://upload.io) supports custom S3 buckets. You are still required to create an account.
218224

219225
## Contribute
220226

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-uploader",
3-
"version": "2.3.3",
3+
"version": "2.3.4",
44
"author": "Upload <hello@upload.io> (https://upload.io)",
55
"description": "React File Upload UI Widget — Lightweight & supports: drag and drop, multiple uploads, image cropping, customization & more 🚀 Comes with Cloud Storage 🌐",
66
"license": "MIT",

0 commit comments

Comments
 (0)