¿Cómo implementar en reaccionar cargando una gran cantidad de archivos a la vez?
especifiqué en input multiplu parece funcionar pero aún no permite cargar más de 1 archivo a la vez
const [fileLoad, setLoadFileState] = useState(false); const [imageState, setImageState] = useState(false); const [image, setImage] = useState<any>([]); const refLabel = useRef<HTMLLabelElement>(null); const openFile = () => refLabel.current?.click(); const uploadFile = () => {} const changeHandler = async (event: React.ChangeEvent<HTMLInputElement>) => { filePromiseAll(event) .then((data) =>{ console.log(data) }) } const filePromiseAll = async (event: React.ChangeEvent<HTMLInputElement>) => { const filePromise:any = new Promise((resolve) => { if(!event.target.files?.length) return; const files = Array.from(event.target.files); files.forEach(file => { if(!file.type.match('image')) return; const reader = new FileReader(); reader.onload = (ev: ProgressEvent<FileReader>) => { if(ev.target) resolve(ev.target.result); } reader.readAsDataURL(file); }) }) return await Promise.all(filePromise); }