Skip to content

Commit

Permalink
fixing renderer props being overwritten (#5417)
Browse files Browse the repository at this point in the history
* fixing renderer props being overwritten

* Create fluffy-keys-bathe.md

Co-authored-by: Mitchell Hamilton <mitchell@hamil.town>
  • Loading branch information
alexmgrant and emmatown committed Apr 12, 2021
1 parent 6cdd8f1 commit 34e3b63
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/fluffy-keys-bathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@keystone-next/document-renderer": patch
---

Fixed `renderers` prop not being respected.
4 changes: 2 additions & 2 deletions packages-next/document-renderer/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ export function DocumentRenderer<ComponentBlocks extends Record<string, Componen
props: DocumentRendererProps<ComponentBlocks>
) {
const renderers = {
inline: { ...props.renderers?.inline, ...defaultRenderers.inline },
block: { ...props.renderers?.block, ...defaultRenderers.block },
inline: { ...defaultRenderers.inline, ...props.renderers?.inline },
block: { ...defaultRenderers.block, ...props.renderers?.block },
};
const componentBlocks = props.componentBlocks || {};
return (
Expand Down

1 comment on commit 34e3b63

@vercel
Copy link

@vercel vercel bot commented on 34e3b63 Apr 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.