АН
Size: a a a
АН
RK
НШ
const TOKEN = localStorage.getItem(KEY_TOKEN_IN_LOCAL_STORAGE);
export const axios = baseAxios.create({
baseURL: '/api',
headers: {
...(TOKEN && {
Authorization: `Token ${TOKEN}`,
}),
},
});
НШ
НШ
RK
VH
export const axios = baseAxios.create({
baseURL: '/api',
headers: {
...(TOKEN && {
get Authorization(){ return `Token ${localStorage.getItem(KEY_TOKEN_IN_LOCAL_STORAGE)}`},
}),
},
});VH
const getToken = () => localStorage.getItem(KEY_TOKEN_IN_LOCAL_STORAGE);
VH
AP
VH
GO
const useComponent = () => {
const [state, setState] = useState({});
const Component = () => <div {...state} />;
return [Component, setState];
}VH
VH
GO
VH
IN
VH
ВБ
ВБ