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.3.3 to 0.3.4

2

dist/lib/useFileUpload.js

@@ -76,3 +76,3 @@ "use strict";

}
}, []);
}, [files]);
/** @function createFormData */

@@ -79,0 +79,0 @@ const createFormData = react_1.useCallback(() => {

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

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

@@ -71,14 +71,17 @@ import { useState, useCallback } from 'react';

/** @function removeFile */
const removeFile = useCallback((file: number | string): void => {
if (typeof file !== 'number' && typeof file !== 'string') {
console.error('argument supplied to removeFile must be of type number or string.');
return;
}
const removeFile = useCallback(
(file: number | string): void => {
if (typeof file !== 'number' && typeof file !== 'string') {
console.error('argument supplied to removeFile must be of type number or string.');
return;
}
if (typeof file === 'string') {
setFilesState(files.filter((_file: File) => _file.name !== file));
} else {
setFilesState(files.filter((_file: File, i) => i !== file));
}
}, []);
if (typeof file === 'string') {
setFilesState(files.filter((_file: File) => _file.name !== file));
} else {
setFilesState(files.filter((_file: File, i) => i !== file));
}
},
[files],
);

@@ -85,0 +88,0 @@ /** @function createFormData */

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