I gone through the documentation of draft-js-mention-plugin but couldn't figure a way to read all the mentions from the content. Is there a way can find all the mentions as array?. I need to store all the mentions seperately and send email.Your help is highly appreciated. I am using the example given in here
Asked
Active
Viewed 1,118 times
1 Answers
4
You can do like below :
const rawEditorContent = convertToRaw(this.state.editorState.getCurrentContent());
const entityMap = rawEditorContent.entityMap;
enter code here
Then loop through entityMap to get mentioned users:
Object.values(entityMap).map(entity => {
console.log(entity.data.mention);
});

rochel hasina
- 41
- 2