score:1


  // uploading images
  if (formData.images.length > 0) {
    setIsFileUploading(true);
    const imgUrls = await Promise.all(
      [...formData.images].map((file) =>
        uploadImages(
          file,
          `${formData.userRef}-${file.name}-${Math.random()}`
        )
      )
    ).catch(() => {
      toast.error("Image couldn't uploaded");
      return;
    });

    if (imgUrls && imgUrls.length > 0) {
      setValue('imageUrls', imgUrls);
    }
    setIsFileUploading(false);
  }


Related Query

More Query from same tag