accesstoken1 [React Native] axios interceptors를 이용해서 헤더 업데이트하기 1. 기존 코드// apiClient.tsimport axios from 'axios';import { getBaseUrl } from '../constants/api';import { getHeaders } from './headers';const useApiClient = () => { const apiClient = axios.create({ baseURL: getBaseUrl(), headers: getHeaders(), }); return apiClient;};const apiClient = useApiClient();export default apiClient;// profile.tsx, 유저의 프로필을 api 요청으로 가져오는 코드import axios from 'axios'.. 2024. 9. 29. 이전 1 다음