Migration: v0.1 → v0.2
v0.2 replaces textarea+overlay rendering with contenteditable. Here's what changed.
Mentions.Input → Mentions.Editor
// Before (v0.1):
<Mentions.Input placeholder="Type @..." />
// After (v0.2):
<Mentions.Editor placeholder="Type @..." /> Mentions.Overlay removed
Mentions render inline as <mark> elements. No overlay needed.
// Before (v0.1):
<Mentions triggers={triggers}>
<Mentions.Overlay />
<Mentions.Input placeholder="Type @..." />
<Mentions.Portal>...</Mentions.Portal>
</Mentions>
// After (v0.2):
<Mentions triggers={triggers}>
<Mentions.Editor placeholder="Type @..." />
<Mentions.Portal>...</Mentions.Portal>
</Mentions> textareaRef → editorRef
// Before:
const { textareaRef } = useMentions({ triggers });
<textarea ref={textareaRef} {...inputProps} />
// After:
const { editorRef } = useMentions({ triggers });
<div ref={editorRef} contentEditable="plaintext-only" {...inputProps} /> Other Removals
overlayRef— removed (no overlay)rowsprop — use CSSmin-heightinsteadinsertTexton handle — useinsertTriggergetCaretCoordinates— removed from core exports
New in v0.2
- Inline mention highlighting
- Native cursor handling
- CSS
::beforeplaceholder - Single-line mode with 5-layer defense
- Grammarly/extension defense
- Runtime
plaintext-onlydetection