From 022fdb0ab789f05addbb7b5ce9890b39b2651a6c Mon Sep 17 00:00:00 2001 From: Celestin NIYONSABA Date: Sun, 10 Apr 2022 17:02:21 +0200 Subject: [PATCH] Updated FileUpload/Index.js Fixed those issues: - CancelToken was failed in Typescript - isCancel not found axios --- src/pages/FileUpload/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/FileUpload/index.js b/src/pages/FileUpload/index.js index ea9cc08..2ffcb06 100644 --- a/src/pages/FileUpload/index.js +++ b/src/pages/FileUpload/index.js @@ -1,10 +1,13 @@ import React, { useState, useRef } from "react"; import Header from "components/Header"; -import axios, { CancelToken, isCancel } from "axios"; +import axios from "axios"; import { ProgressBar } from "react-bootstrap"; import ExternalInfo from "components/ExternalInfo"; import AppConfig from "App.config"; +const cancelToken = axios.CancelToken; +const isCancel = axios.isCancel; + const FileUpload = () => { const [uploadPercentage, setUploadPercentage] = useState(0); const cancelFileUpload = useRef(null);