From 2f1162022161910c046e978a9b9083dc5a7b8646 Mon Sep 17 00:00:00 2001 From: Whitewater Date: Mon, 29 Aug 2022 16:25:30 +0800 Subject: [PATCH] fix: kanban tree view (#342) --- libs/components/editor-core/src/render-block/Context.tsx | 2 +- .../editor-core/src/render-block/WithTreeViewChildren.tsx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/components/editor-core/src/render-block/Context.tsx b/libs/components/editor-core/src/render-block/Context.tsx index d34f5d6801..e5c0197eee 100644 --- a/libs/components/editor-core/src/render-block/Context.tsx +++ b/libs/components/editor-core/src/render-block/Context.tsx @@ -27,7 +27,7 @@ export const BlockRenderProvider = ({ ); }; -const useBlockRender = () => { +export const useBlockRender = () => { const { blockRender } = useContext(BlockRenderContext); return { BlockRender: blockRender, diff --git a/libs/components/editor-core/src/render-block/WithTreeViewChildren.tsx b/libs/components/editor-core/src/render-block/WithTreeViewChildren.tsx index 6dccd49ace..8c3642ef6d 100644 --- a/libs/components/editor-core/src/render-block/WithTreeViewChildren.tsx +++ b/libs/components/editor-core/src/render-block/WithTreeViewChildren.tsx @@ -7,7 +7,7 @@ import type { } from 'react'; import { forwardRef } from 'react'; import { CreateView } from '../editor'; -import { BlockRender } from './Context'; +import { useBlockRender } from './Context'; import { NullBlockRender } from './RenderBlock'; type WithChildrenConfig = { @@ -60,6 +60,7 @@ export const withTreeViewChildren = ( return (props: CreateView) => { const { block } = props; + const { BlockRender } = useBlockRender(); const collapsed = block.getProperty('collapsed')?.value; const childrenIds = block.childrenIds; const showChildren =