![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@rpldy/upload-button
Advanced tools
Upload button component and asUploadButton HOC
Initiate file upload by opening the browser's native file selection dialog.
Buttons can use different configuration overrides that supersede the options passed to the parent Uploady.
Note: Some options cannot be overriden by the button. For example, any prop that influences the file input directly (such as 'multiple')
#Yarn:
$ yarn add @rpldy/uploady @rpldy/upload-button
#NPM:
$ npm i @rpldy/uploady @rpldy/upload-button
Name (* = mandatory) | Type | Default | Description |
---|---|---|---|
id | string | undefined | id attribute to pass to the button element |
text | string | "Upload" | the button text (in case no children passed) |
className | string | undefined | the class attribute to pass to the button element |
children | React.Node | undefined | child element(s) to render inside the button (replaces text) |
extraProps | Object | undefined | any other props to pass to the button component (with spread) |
ref | React ref | undefined will be passed to the button element to acquire a ref |
In addition, most UploadOptions props can be passed to UploadButton. In order to override configuration passed to the parent Uploady component. See Uploady documentation for detailed list of upload options.
The following guide shows how different upload buttons may use different upload options.
This examples shows how you add Uploady and UploadButton to your app. This is all it takes to get file uploading to work in your React app.
import React from "react";
import Uploady from "@rpldy/uploady";
import UploadButton from "@rpldy/upload-button";
const App = () => (<Uploady
destination={{ url: "https://my-server/upload" }}>
<UploadButton/>
</Uploady>);
In case you want to use your own component as the upload trigger, use the asUploadButton HOC:
import React from "react";
import Uploady from "@rpldy/uploady";
import { asUploadButton } from "@rpldy/upload-button";
const DivUploadButton = asUploadButton((props) => {
return <div {...props} style={{ cursor: "pointer" }}>
DIV Upload Button
</div>
});
const App = () => (<Uploady
destination={{ url: "https://my-server/upload" }}>
<DivUploadButton/>
</Uploady>);
0.2.4 (2020-06-10)
[upload-preview]
- preview methods: clear (previewMethodsRef)[upload-preview]
- access to preview items array (onPreviewsChanged)[chunked-uploady]
- chunk event hooks (start/finish)[shared]
- updateable - proxy only in dev. proxy additions to state[chunked-uploady]
- document chunk event hooks[chunked-sender]
- document chunk eventsguides
- Upload Queue guideFAQs
upload button component and asUploadButton HOC
The npm package @rpldy/upload-button receives a total of 4,410 weekly downloads. As such, @rpldy/upload-button popularity was classified as popular.
We found that @rpldy/upload-button demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.