Path: blob/master/src/packages/frontend/editors/slate/slate-mentions/README.md
1698 views
This is adapted from the https://github.com/ianstormtaylor/slate/blob/master/site/examples/mentions.tsx
To use this in a slate editor, you would do something like what is below, but with your own version of insertMention. This isn't an Editor plugin, since I don't know how to hook into the onChange and onKeyDown events in a plugin. Instead I made a React hook that has onChange and onKeyDown functions that you call in those callbacks in your own code [1].
[1] I found another mentions plugin for slate here, and it takes the exact same approach, so I guess this is perhaps the best way to do this...?