security/codeql-dependabot-gitleaks
| 1 | import { useContext } from "react" |
| 2 | import { RouteModalProviderContext } from "./route-modal-context" |
| 3 | |
| 4 | export const useRouteModal = () => { |
| 5 | const context = useContext(RouteModalProviderContext) |
| 6 | |
| 7 | if (!context) { |
| 8 | throw new Error("useRouteModal must be used within a RouteModalProvider") |
| 9 | } |
| 10 | |
| 11 | return context |
| 12 | } |