Preact
ProseKit has first-class support for Preact via prosekit/preact.
Provider
Section titled “Provider”<ProseKit editor={editor}> provides context to its descendants. The component itself does not render any DOM, it only forwards children. Always wrap any UI that calls useEditor() in this provider.
Same shape as React:
useEditor()→EditoruseEditorDerivedValue(derive, options?)→ derived valueuseExtension(extension, options?)useKeymap(keymap, options?)useDocChange(handler: (doc: ProseMirrorNode) => void, options?)useStateUpdate(handler: (state: EditorState) => void, options?)
Custom node and mark views
Section titled “Custom node and mark views”definePreactMarkView is the mark equivalent.
See also
Section titled “See also”- React: full hook documentation that applies here too.
- The Editor concept page
prosekit/preactreference- Minimal example
- Full-featured example