'init'
This commit is contained in:
11
app/providers/DeviceProvider/useDeviceId.ts
Normal file
11
app/providers/DeviceProvider/useDeviceId.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { useContext } from "react";
|
||||
import { DeviceProviderContext } from "./DeviceProvider";
|
||||
|
||||
export function useDeviceId(): string {
|
||||
const context = useContext(DeviceProviderContext);
|
||||
if(!context) {
|
||||
throw new Error("useDeviceId must be used within a DeviceProvider");
|
||||
}
|
||||
|
||||
return context.deviceId;
|
||||
}
|
||||
Reference in New Issue
Block a user