New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@uploadcare/react-uploader

Package Overview
Dependencies
Maintainers
4
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uploadcare/react-uploader

  • 0.2.0-alpha.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.9K
increased by6.23%
Maintainers
4
Weekly downloads
 
Created
Source

Uploadcare React Uploader

Uploadcare React Uploader. Allows you to use Uploader in React applications according to React canons.

Build Status NPM version GitHub release Uploadcare stack on StackShare

Install

npm i @uploadcare/react-uploader

Usage

import { FileUploaderRegular } from "@uploadcare/react-uploader";

<FileUploaderRegular pubkey="YOUR_PUBLIC_KEY"/>;

File Uploader API

It is possible to get ref on UploadCtxProvider via ref. In this way it is possible to additional uploader management methods.

import React, { useRef } from "react";
import {
    FileUploaderRegular,
    UploadCtxProvider
} from "@uploadcare/react-uploader";

const uploaderRef = useRef<InstanceType<UploadCtxProvider> | null>(null);

<FileUploaderRegular refUploadCtxProvider={uploaderRef} pubkey="YOUR_PUBLIC_KEY"/>;

Events

Events in React Uploader are the same as in blocks, see the documentation. The principle of converting events from blocks to React Uploader:

  1. All events in React Uploader start with on.
  2. All events in React Uploader in camelCase.

Example:

import { FileUploaderRegular } from "@uploadcare/react-uploader";

<FileUploaderRegular
    pubkey="YOUR_PUBLIC_KEY"
    onModalOpen={() => {
        console.log('modal-open')
    }}
/>

Table of events

Events blocksEvents React Uploader
file-addedonFileAdded
file-removedonFileRemoved
file-upload-startonFileUploadStart
file-upload-progressonFileUploadProgress
file-upload-successonFileUploadSuccess
file-upload-failedonFileUploadFailed
file-url-changedonFileUrlChanged
modal-openonModalOpen
modal-closeonModalClose
done-clickonDoneClick
upload-clickonUploadClick
activity-changeonActivityChange
common-upload-startonCommonUploadStart
common-upload-progressonCommonUploadProgress
common-upload-successonCommonUploadSuccess
common-upload-failedonCommonUploadFailed
changeonChange
group-createdonGroupCreated

Security issues

If you think you ran into something in Uploadcare libraries that might have security implications, please hit us up at bugbounty@uploadcare.com or Hackerone.

We'll contact you personally in a short time to fix an issue through co-op and prior to any public disclosure.

Feedback

Issues and PRs are welcome. You can provide your feedback or drop us a support request at hello@uploadcare.com.

Keywords

FAQs

Package last updated on 15 Apr 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc