Markdown editor for React JS
Can be installed via npm:
npm install --save react-edit-it
Or yarn
yarn add react-edit-it
The most basic use of the markdown editor can be described with:
import React, { Component } from "react";
import ReactMarkdownEditor from "react-edit-it";
class Example extends Component {
onChangeContent = props => {
// Access Props
};
render() {
return (
<ReactMarkdownEditor
// Pass the text content to be converted to markdown as props
content="demo"
onChangeContent={this.onChangeContent}
/>
);
}
}
onChangeContent
event handler fires each time when the content has been edited. You can use it to access the editor text content
Compatible with the latest version of 16.x
- 15.x and 16.x
Property | Type | Description |
---|---|---|
content | string | Markdown content to be converted |
onChangeContent | func | Called when the editor content is updated |
Code sample is available in the /example directory for your perusal. You can execute npm install to generate the necessary dependencies for the examples.
if you haven't, You may need to install,
- npm or nvm (Go with nvm, its much easier to switch versions! )
- Node 8.16.0 or Node 10.16.0 or later version
MIT © HasiniWijerathna