mirror of
https://github.com/aljazceru/rabbit.git
synced 2025-12-17 14:04:21 +01:00
update
This commit is contained in:
11
src/hooks/useFileInput.ts
Normal file
11
src/hooks/useFileInput.ts
Normal 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 };
|
||||
};
|
||||
Reference in New Issue
Block a user