Update
This commit is contained in:
9
resources/js/plugins/AxiosContext.jsx
Normal file
9
resources/js/plugins/AxiosContext.jsx
Normal file
@@ -0,0 +1,9 @@
|
||||
// resources/js/Plugins/AxiosContext.js
|
||||
import { createContext, useContext } from 'react';
|
||||
import axiosInstance from './axios-plugin';
|
||||
|
||||
const AxiosContext = createContext();
|
||||
|
||||
export const AxiosProvider = ({ children }) => <AxiosContext.Provider value={axiosInstance}>{children}</AxiosContext.Provider>;
|
||||
|
||||
export const useAxios = () => useContext(AxiosContext);
|
||||
Reference in New Issue
Block a user