mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-12 07:56:40 +00:00
env context and refactor api support different ports
This commit is contained in:
10
src/hooks/useEnvContext.ts
Normal file
10
src/hooks/useEnvContext.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import EnvContext from "@app/contexts/envContext";
|
||||
import { useContext } from "react";
|
||||
|
||||
export function useEnvContext() {
|
||||
const context = useContext(EnvContext);
|
||||
if (context === undefined) {
|
||||
throw new Error("useEnvContext must be used within an EnvProvider");
|
||||
}
|
||||
return context;
|
||||
}
|
||||
Reference in New Issue
Block a user