0

I am getting this error when I upload the files in cloudinary.

  const [images, setImages] = useState([]);

 function showWidget(){
    const widget= window.cloudinary.createUploadWidget(
      {
        cloudName:'djguiefro',
        uploadPreset:'fz1sjhdc',
      },
      (error, result)=>{
        if(!error && result.event ==='success'){
          setImages((prev)=>[...prev,{url:result.info.url, public_id:result.info.public_id}])
        }
        else{
          console.log(error)
        }
      }
    );
    widget.open();
  }`
<Form.Group className='mb-3'>
                  <Button type='button' onClick={showWidget}>Upload Images</Button>
                  <div className='images-preview-container'>
                    {/* 2:11:34 */}
                    {images.map((image)=>(
                      <div className='images-preview'>
                        <img src={image.url}/>

                        {/*add items for removing  {(imgToRemove != image.public_id) this will remove the cross icon once clicked }*/}
                        {imgToRemove !== image.public_id && <i className='fa fa-times-circle' onClick={()=>handleRemoveImg(image)}></i>}
                      </div>
                    ))}
                  </div>
                </Form.Group>`

I tried to fix the error but stuck

DreamBold
  • 2,727
  • 1
  • 9
  • 24
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Dec 27 '22 at 07:01

0 Answers0