A simple stackoverflow inspired editor.
npm install --save simple-react-editor
import React, { Component } from 'react';
import SimplexEditor from 'simple-react-editor';
class Example extends Component {
addArticleToState = value => {
this.setState({ article: value });
};
render() {
return <SimplexEditor getArticle={this.AddArticleToState} />;
}
}
if you want to insert html content into the editor for editing purpose
import React, { Component } from 'react';
import SimplexEditor from 'simple-react-editor';
class Example extends Component {
addArticleToState = value => {
this.setState({ article: value });
};
htmlBody = `
<h1>Hello World</h1>
<p>We choose to fight because you need to be recognized</p>
`
render() {
return <SimplexEditor getArticle={this.AddArticleToState} content={this.htmlBody}/>;
}
}
MIT © truestbyheart