Skip to content

Commit

Permalink
feat: add usePuck hook
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvxd committed Dec 11, 2023
1 parent 3fcf8e3 commit 13f3ccb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
7 changes: 7 additions & 0 deletions packages/core/lib/use-puck.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { useAppContext } from "../components/Puck/context";

export const usePuck = () => {
const { state: appState, config, dispatch } = useAppContext();

return { appState, config, dispatch };
};

0 comments on commit 13f3ccb

Please sign in to comment.