UNPKG

@oberoncms/core

Version:

OberonCMS is a cloud deployable CMS written in typescript based on the Puck visual editor

21 lines (20 loc) 533 B
import { useContext } from "react"; import { ActionsContext, ClientContext } from "../components/provider.js"; const useOberonActions = () => { const context = useContext(ActionsContext); if (!context) { throw new Error("No Oberon Server Actions provided"); } return context; }; const useOberonClientContext = () => { const context = useContext(ClientContext); if (!context) { throw new Error("No Oberon Client Context provided"); } return context; }; export { useOberonActions, useOberonClientContext };