diff --git a/packages/core/index.ts b/packages/core/index.ts index 5b2a914999..0a0b4d3ed9 100644 --- a/packages/core/index.ts +++ b/packages/core/index.ts @@ -13,5 +13,6 @@ export * from "./components/Render"; export * from "./lib/migrate"; export * from "./lib/transform-props"; export * from "./lib/resolve-all-data"; +export { usePuck } from "./lib/use-puck"; export { FieldLabel } from "./components/InputOrGroup"; diff --git a/packages/core/lib/use-puck.ts b/packages/core/lib/use-puck.ts new file mode 100644 index 0000000000..e0830415ae --- /dev/null +++ b/packages/core/lib/use-puck.ts @@ -0,0 +1,7 @@ +import { useAppContext } from "../components/Puck/context"; + +export const usePuck = () => { + const { state: appState, config, dispatch } = useAppContext(); + + return { appState, config, dispatch }; +};