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

Type Script Property 'login' does not exist on type 'unknown'

$
0
0

Hello i converted Java script code into type Type Script the every this is working fine but Following issue is i am facing while Development pls explain the exact issue and help me out in this thanks in advance

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

Abc screen

const { login } = useAuth();//Property 'login' does not exist on type 'unknown'.const login = async (_user:any) => {setUser(_user);setIsLoggedIn(true);axios.interceptors.request.use((config:any) => {  config.headers.authorization = _user?.token;  return config;});    const serializedUser = JSON.stringify(_user);await AsyncStorage.setItem("@zenbase_user", serializedUser);|| []));

};


Viewing all articles
Browse latest Browse all 6287

Trending Articles



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