title: React toastify dismiss method not working?
body: <p>While uploading file I want to show the progress of upload. So I used react toastify package. But after the upload completes I am calling <code>dismiss()</code> method to dismiss the toast programmatically but the toast is not closing. I also tried <code>autoClose</code> attribute, it's also not working.</p>
  <pre><code>const toastId = useRef(null)
  
  const sendFile = async () =&gt; {
      try{
          const formData = new FormData()
          formData.append(&quot;file&quot;, file) // file is a state
  
          await axios.post(
              &quot;/api/message&quot;,
              formData,
              {
                  headers: {&quot;Content-type&quot;: &quot;multipart/form-data&quot;}
              },
              onUploadProgress: p =&gt; {
                  const progress = (p.loaded / p.total);
  
                  if (toastId.current === null) {
                      toastId.current = toast.info('Upload in Progress', {
                          progress,
                          hideProgressBar: false
                      });
                  } else {
                      t.update(toastId.current, { progress });
                  }
              }}
          );
  
          toast.update(toastId.current, {
              render: &quot;File sent successfully&quot;,
              type: &quot;success&quot;
          })
  
          toast.dismiss();
          toastId.current = null
  
      } catch (error) {
          toast.update(toastId.current, {
              render: error.response.data.message,
              type: &quot;error&quot;,
          });
          toast.dismiss();
          toastId.current = null
      }
  };
  </code></pre>