react-use-file-upload
Advanced tools
Comparing version 0.5.0 to 0.6.0
@@ -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, |
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
14654