text: import React, { Component } from 'react';
  import ReactDOM from 'react-dom';
  import { Remarkable } from 'remarkable';
  class MarkdownEditor extends Component {
  	constructor(props) {
  		super(props);
  		this.md = new Remarkable();
  		this.handleChange = this.handleChange.bind(this);
  		this.state = { value: 'Привет, **мир**!' };
  	}
  	handleChange(e) {
  		this.setState({ value: e.target.value });
  	}
  	getRawMarkup() {
  		return { __html: this.md.render(this.state.value) };
  	}
  	render() {
  		return (
  			<div className="MarkdownEditor">
  				<h3>Редактор</h3>
  				<label htmlFor="markdown-content">Введите что-нибудь</label>
  				<br />
  				<br />
  				<textarea
  					id="markdown-content"
  					onChange={this.handleChange}
  					defaultValue={this.state.value}
  				/>
  				<h3>Вывод</h3>
  				<div
  					className="content"
  					dangerouslySetInnerHTML={this.getRawMarkup()}
  				/>
  			</div>
  		);
  	}
  }
  
  ReactDOM.render(<MarkdownEditor />, document.getElementById('root'));
  