This commit is contained in:
Shusui MOYATANI
2023-03-17 09:38:28 +09:00
parent 158d0e3a20
commit c34143065b
23 changed files with 421 additions and 246 deletions

11
src/hooks/useFileInput.ts Normal file
View File

@@ -0,0 +1,11 @@
import { createSignal, type JSX } from 'solid-js';
const useFileInput = () => {
const [file, setFile] = createSignal<File | undefined>();
const handleChange: JSX.EventHandler<HTMLInputElement, Event> = (ev) => {
setFile(ev.currentTarget.files?.[0]);
};
return { file, handleChange };
};