Created
June 13, 2021 15:41
-
-
Save DZuz14/9d9f2d20a7c75af509c16e4fa1d54e3d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useState, useEffect } from 'react'; | |
export const useFileUpload = () => { | |
const [files, setFilesState] = useState([]) | |
const setFiles = files => { | |
setFilesState(Array.from(files)) | |
} | |
return { | |
files, | |
setFiles | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment