Browse Source

bug-fix

imwald
Silberengel 1 month ago
parent
commit
4394d3bd21
  1. 2
      package.json
  2. 5
      src/components/PostEditor/PostTextarea/index.tsx

2
package.json

@ -1,6 +1,6 @@
{ {
"name": "jumble-imwald", "name": "jumble-imwald",
"version": "20.0.1", "version": "20.0.2",
"description": "A user-friendly Nostr client focused on relay feed browsing and relay discovery, forked from Jumble", "description": "A user-friendly Nostr client focused on relay feed browsing and relay discovery, forked from Jumble",
"private": true, "private": true,
"type": "module", "type": "module",

5
src/components/PostEditor/PostTextarea/index.tsx

@ -109,6 +109,8 @@ const PostTextarea = forwardRef<
} }
}, [activeTab, getDraftEventJson, kind]) }, [activeTab, getDraftEventJson, kind])
const editor = useEditor({ const editor = useEditor({
// TipTap + Radix Dialog/Tabs: defer init so React 18 does not warn about flushSync in a lifecycle.
immediatelyRender: false,
extensions: [ extensions: [
Document, Document,
Paragraph, Paragraph,
@ -237,7 +239,8 @@ const PostTextarea = forwardRef<
</div> </div>
)} )}
</div> </div>
<TabsContent value="edit"> {/* Keep editor mounted: remounting EditorContent after Preview/Json triggers TipTap flushSync under React 18. */}
<TabsContent value="edit" forceMount>
<EditorContent className="tiptap" editor={editor} /> <EditorContent className="tiptap" editor={editor} />
</TabsContent> </TabsContent>
<TabsContent value="preview"> <TabsContent value="preview">

Loading…
Cancel
Save