From 29ddaaf376b57134be46a489e7686978d0465669 Mon Sep 17 00:00:00 2001 From: Chris Villa Date: Tue, 17 Oct 2023 18:24:54 +0100 Subject: [PATCH] feat: expose state to renderHeader, removing data This is a breaking change as we remove data in favour of state, which contains data. --- packages/core/components/Puck/index.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/core/components/Puck/index.tsx b/packages/core/components/Puck/index.tsx index 0d2ce8d4d9..4412d62dd6 100644 --- a/packages/core/components/Puck/index.tsx +++ b/packages/core/components/Puck/index.tsx @@ -77,11 +77,11 @@ export function Puck({ plugins?: Plugin[]; renderHeader?: (props: { children: ReactNode; - data: Data; dispatch: (action: PuckAction) => void; + state: AppState; }) => ReactElement; renderHeaderActions?: (props: { - data: Data; + state: AppState; dispatch: (action: PuckAction) => void; }) => ReactElement; headerTitle?: string; @@ -300,8 +300,8 @@ export function Puck({ Publish ), - data, dispatch, + state: appState, }) ) : (
{renderHeaderActions && - renderHeaderActions({ data, dispatch })} + renderHeaderActions({ + state: appState, + dispatch, + })}