Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-use-file-upload

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-use-file-upload - npm Package Compare versions

Comparing version 0.5.0 to 0.6.0

2

dist/lib/types.d.ts

@@ -7,3 +7,3 @@ export declare type useFileUploadHook = {

totalSizeInBytes: number;
clearAll: () => void;
clearAllFiles: () => void;
createFormData: () => FormData;

@@ -10,0 +10,0 @@ handleDragDropEvent: (e: Event) => void;

@@ -88,4 +88,4 @@ "use strict";

}, [files]);
/** @function clearAll */
const clearAll = react_1.useCallback(() => {
/** @function clearAllFiles */
const clearAllFiles = react_1.useCallback(() => {
setFilesState([]);

@@ -107,3 +107,3 @@ }, []);

totalSizeInBytes,
clearAll,
clearAllFiles,
createFormData,

@@ -110,0 +110,0 @@ handleDragDropEvent,

{
"name": "react-use-file-upload",
"version": "0.5.0",
"version": "0.6.0",
"description": "A React Hook to make dealing with file uploading easier.",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -47,5 +47,5 @@ # React useFileUpload

### clearAll
### clearAllFiles
A function that will remove all files in a single swipe.
A function that will remove all files in the `files` array.

@@ -52,0 +52,0 @@ ```

@@ -20,3 +20,3 @@ import { renderHook, act } from '@testing-library/react-hooks';

const { result } = renderHook(() => useFileUpload());
expect(typeof result.current.clearAll).toBe('function');
expect(typeof result.current.clearAllFiles).toBe('function');
expect(typeof result.current.createFormData).toBe('function');

@@ -23,0 +23,0 @@ expect(typeof result.current.handleDragDropEvent).toBe('function');

@@ -7,3 +7,3 @@ export type useFileUploadHook = {

totalSizeInBytes: number;
clearAll: () => void;
clearAllFiles: () => void;
createFormData: () => FormData;

@@ -10,0 +10,0 @@ handleDragDropEvent: (e: Event) => void;

@@ -99,4 +99,4 @@ import { useState, useCallback, useEffect } from 'react';

/** @function clearAll */
const clearAll = useCallback((): void => {
/** @function clearAllFiles */
const clearAllFiles = useCallback((): void => {
setFilesState([]);

@@ -122,3 +122,3 @@ }, []);

totalSizeInBytes,
clearAll,
clearAllFiles,
createFormData,

@@ -125,0 +125,0 @@ handleDragDropEvent,

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