Skip to content

Commit

Permalink
fix(portable-text-editor): suppress esbuild jsx transformation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
rexxars committed Aug 2, 2022
1 parent f049107 commit 7bbf891
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/@sanity/portable-text-editor/src/editor/Element.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export const Element: FunctionComponent<ElementProps> = ({
)
: textBlock
return (
<div {...attributes} key={element._key} className={className}>
<div key={element._key} {...attributes} className={className}>
<DraggableBlock element={element} readOnly={readOnly} blockRef={blockRef}>
<div ref={blockRef}>{propsOrDefaultRendered}</div>
</DraggableBlock>
Expand All @@ -183,7 +183,7 @@ export const Element: FunctionComponent<ElementProps> = ({
const renderedBlockFromProps =
renderBlock && renderBlock(block, type, renderAttribs, defaultRender, blockRef)
return (
<div {...attributes} key={element._key} className={className}>
<div key={element._key} {...attributes} className={className}>
{children}
<DraggableBlock element={element} readOnly={readOnly} blockRef={blockRef}>
{renderedBlockFromProps && (
Expand Down
2 changes: 1 addition & 1 deletion packages/@sanity/portable-text-editor/src/editor/Leaf.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export const Leaf = (props: LeafProps) => {
const key = leaf._key || keyGenerator()

return (
<span {...attributes} ref={spanRef} key={key}>
<span key={key} {...attributes} ref={spanRef}>
<DraggableChild element={leaf} readOnly={readOnly}>
{returnedChildren}
</DraggableChild>
Expand Down

0 comments on commit 7bbf891

Please sign in to comment.