react-md-editor
react-md-editor copied to clipboard
Support @ mentions
allowing users to @ mention would be a helpful feature
@enahs Example: https://codesandbox.io/embed/markdown-editor-for-react-uiwjs-react-md-editor-issues-420-vto6ge?fontsize=14&hidenavigation=1&theme=dark
import React from "react";
import ReactDOM from "react-dom";
import { MentionsInput, Mention } from "react-mentions";
import Mentions from "rc-mentions";
import MDEditor from "@uiw/react-md-editor";
import "./index.css";
const mkdStr = `# Markdown Editor for [React]
**Hello world!!!**`;
function App() {
const [value, setValue] = React.useState(mkdStr);
return (
<div className="container">
<MDEditor
renderTextarea={(props, { onChange }) => {
return (
<Mentions
value={props.value}
onChange={(newValue) => setValue(newValue)}
>
<Mentions.Option value="light">Light</Mentions.Option>
<Mentions.Option value="bamboo">Bamboo</Mentions.Option>
<Mentions.Option value="cat">Cat</Mentions.Option>
</Mentions>
);
}}
height={200}
value={value}
onChange={setValue}
/>
</div>
);
}
ReactDOM.render(<App />, document.getElementById("container"));
Super helpful. very useful feature. should add to the readme!
This crashes whole markdown editor when trying to do other tasks