Skip to content

Commit

Permalink
feat: expose state to renderHeader, removing data
Browse files Browse the repository at this point in the history
This is a breaking change as we remove data in favour of state, which contains data.
  • Loading branch information
chrisvxd committed Oct 18, 2023
1 parent c276b23 commit 29ddaaf
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/core/components/Puck/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -300,8 +300,8 @@ export function Puck({
Publish
</Button>
),
data,
dispatch,
state: appState,
})
) : (
<div
Expand Down Expand Up @@ -389,7 +389,10 @@ export function Puck({
</IconButton>
</div>
{renderHeaderActions &&
renderHeaderActions({ data, dispatch })}
renderHeaderActions({
state: appState,
dispatch,
})}
<Button
onClick={() => {
onPublish(data);
Expand Down

0 comments on commit 29ddaaf

Please sign in to comment.