fix: kanban tree view (#342)

This commit is contained in:
Whitewater
2022-08-29 16:25:30 +08:00
committed by GitHub
parent 7d6b552dbd
commit 2f11620221
2 changed files with 3 additions and 2 deletions

View File

@@ -27,7 +27,7 @@ export const BlockRenderProvider = ({
); );
}; };
const useBlockRender = () => { export const useBlockRender = () => {
const { blockRender } = useContext(BlockRenderContext); const { blockRender } = useContext(BlockRenderContext);
return { return {
BlockRender: blockRender, BlockRender: blockRender,

View File

@@ -7,7 +7,7 @@ import type {
} from 'react'; } from 'react';
import { forwardRef } from 'react'; import { forwardRef } from 'react';
import { CreateView } from '../editor'; import { CreateView } from '../editor';
import { BlockRender } from './Context'; import { useBlockRender } from './Context';
import { NullBlockRender } from './RenderBlock'; import { NullBlockRender } from './RenderBlock';
type WithChildrenConfig = { type WithChildrenConfig = {
@@ -60,6 +60,7 @@ export const withTreeViewChildren = (
return (props: CreateView) => { return (props: CreateView) => {
const { block } = props; const { block } = props;
const { BlockRender } = useBlockRender();
const collapsed = block.getProperty('collapsed')?.value; const collapsed = block.getProperty('collapsed')?.value;
const childrenIds = block.childrenIds; const childrenIds = block.childrenIds;
const showChildren = const showChildren =