react-use-file-upload
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -45,2 +45,3 @@ "use strict"; | ||
const filesArr = Array.from(files); | ||
setFilesState(filesArr); | ||
handleSizes(filesArr); | ||
@@ -57,9 +58,9 @@ } | ||
/** @function getFileNames */ | ||
const getFileNames = react_1.useCallback(() => { | ||
const getFileNames = () => { | ||
return files.map((file) => file.name); | ||
}, [files]); | ||
}; | ||
/** @function getFileTypes */ | ||
const getFileTypes = react_1.useCallback(() => { | ||
const getFileTypes = () => { | ||
return files.map((file) => file.type); | ||
}, [files]); | ||
}; | ||
/** @function removeFile */ | ||
@@ -66,0 +67,0 @@ const removeFile = react_1.useCallback((file) => { |
{ | ||
"name": "react-use-file-upload", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "A React Hook to make dealing with file uploading easier.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -47,2 +47,3 @@ import { useState, useCallback } from 'react'; | ||
const filesArr: File[] = Array.from(files); | ||
setFilesState(filesArr); | ||
handleSizes(filesArr); | ||
@@ -61,10 +62,10 @@ } | ||
/** @function getFileNames */ | ||
const getFileNames = useCallback((): string[] => { | ||
const getFileNames = () => { | ||
return files.map((file) => file.name); | ||
}, [files]); | ||
}; | ||
/** @function getFileTypes */ | ||
const getFileTypes = useCallback((): string[] => { | ||
const getFileTypes = () => { | ||
return files.map((file) => file.type); | ||
}, [files]); | ||
}; | ||
@@ -71,0 +72,0 @@ /** @function removeFile */ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
251
12425