mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-29 14:18:26 +02:00
env context and refactor api support different ports
This commit is contained in:
parent
d79760dad9
commit
d3d2fe398b
35 changed files with 287 additions and 135 deletions
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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue