Merge pull request #253 from toeverything/fix/console-error
Fix/console error
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
import {
|
import {
|
||||||
|
BlockPendantProvider,
|
||||||
CreateView,
|
CreateView,
|
||||||
RenderBlock,
|
RenderBlock,
|
||||||
useCurrentView,
|
useCurrentView,
|
||||||
useOnSelect,
|
useOnSelect,
|
||||||
BlockPendantProvider,
|
|
||||||
} from '@toeverything/components/editor-core';
|
} from '@toeverything/components/editor-core';
|
||||||
import { styled } from '@toeverything/components/ui';
|
import { styled } from '@toeverything/components/ui';
|
||||||
import type {
|
import type {
|
||||||
@@ -60,8 +60,8 @@ const ChildrenView = ({
|
|||||||
{childrenIds.map((childId, idx) => {
|
{childrenIds.map((childId, idx) => {
|
||||||
if (isKanbanScene) {
|
if (isKanbanScene) {
|
||||||
return (
|
return (
|
||||||
<StyledBorder>
|
<StyledBorder key={childId}>
|
||||||
<RenderBlock key={childId} blockId={childId} />
|
<RenderBlock blockId={childId} />
|
||||||
</StyledBorder>
|
</StyledBorder>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,11 +25,11 @@ export function RenderBlock({
|
|||||||
[block]
|
[block]
|
||||||
);
|
);
|
||||||
|
|
||||||
const blockView = useMemo(() => {
|
const BlockView = useMemo(() => {
|
||||||
if (block?.type) {
|
if (block?.type) {
|
||||||
return editor.getView(block.type);
|
return editor.getView(block.type).View;
|
||||||
}
|
}
|
||||||
return null;
|
return () => null;
|
||||||
}, [editor, block?.type]);
|
}, [editor, block?.type]);
|
||||||
|
|
||||||
if (!block) {
|
if (!block) {
|
||||||
@@ -44,22 +44,22 @@ export function RenderBlock({
|
|||||||
columns: block.columns ?? [],
|
columns: block.columns ?? [],
|
||||||
};
|
};
|
||||||
|
|
||||||
const view = blockView?.View ? (
|
const view = (
|
||||||
<blockView.View
|
<BlockView
|
||||||
editor={editor}
|
editor={editor}
|
||||||
block={block}
|
block={block}
|
||||||
columns={columns.columns}
|
columns={columns.columns}
|
||||||
columnsFromId={columns.fromId}
|
columnsFromId={columns.fromId}
|
||||||
editorElement={editorElement}
|
editorElement={editorElement}
|
||||||
/>
|
/>
|
||||||
) : null;
|
);
|
||||||
|
|
||||||
return hasContainer ? (
|
return hasContainer ? (
|
||||||
<BlockContainer block-id={blockId} ref={setRef} data-block-id={blockId}>
|
<BlockContainer block-id={blockId} ref={setRef} data-block-id={blockId}>
|
||||||
{view}
|
{view}
|
||||||
</BlockContainer>
|
</BlockContainer>
|
||||||
) : (
|
) : (
|
||||||
<> {view}</>
|
view
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -171,7 +171,9 @@ const Container = styled('div')({
|
|||||||
display: 'contents',
|
display: 'contents',
|
||||||
});
|
});
|
||||||
|
|
||||||
const BasicStyledPopper = styled(PopperUnstyled)<{
|
const BasicStyledPopper = styled(PopperUnstyled, {
|
||||||
|
shouldForwardProp: propName => !['zIndex'].some(name => name === propName),
|
||||||
|
})<{
|
||||||
zIndex?: number;
|
zIndex?: number;
|
||||||
}>(({ zIndex, theme }) => {
|
}>(({ zIndex, theme }) => {
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user