Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix: once block type changed, the TextBlock node should be re-render (#551)

zuomeng wangb59b010decb9
diff --git a/libs/components/editor-blocks/src/blocks/text/TextView.tsx b/libs/components/editor-blocks/src/blocks/text/TextView.tsx
index 2fb9ff62e1..237460f38f 100644
--- a/libs/components/editor-blocks/src/blocks/text/TextView.tsx
+++ b/libs/components/editor-blocks/src/blocks/text/TextView.tsx
@@ -266,6 +266,8 @@ export const TextView = ({
>
<BlockPendantProvider editor={editor} block={block}>
<TextBlock
+ // Once the block type changed, this node should be re-render
+ key={`${block.id}_${block.type}`}
block={block}
type={block.type}
editor={editor}