Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

TypeScript Property 'handleError' does not exist on type 'AxiosStatic'

$
0
0

Hello I Converted React Native Java Script Project into Typescript all working is fine but some warning is showing me please any one help me out in this ! How to pass props from other folder please look into

  import Axios from "axios";  import config from "../../config";  const axios = Axios;  axios.defaults.baseURL = config.API_URL;  axios.handleError = (error:any)  => { //Error ---Property 'handleError' does not exist on type 'AxiosStatic'.  if (error?.response?.data?.error) { console.log("handleError@@@",error?.response?.data?.error+"") } };export default axios;

i used Axios fo API call so please anyone suggest me how to use error handling in TypeScript


Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>