authentification keyloack + début front
This commit is contained in:
10
front_end/src/context/useLocalData.tsx
Normal file
10
front_end/src/context/useLocalData.tsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import { useContext } from 'react'
|
||||
import { LocalDataContext } from './LocalDataContext2'
|
||||
|
||||
export const useLocalData = () => {
|
||||
const context = useContext(LocalDataContext)
|
||||
if (!context) {
|
||||
throw new Error('useLocalData must be used within LocalDataProvider')
|
||||
}
|
||||
return context
|
||||
}
|
||||
Reference in New Issue
Block a user