Editor.js 564 B

123456789101112131415161718192021222324252627
  1. var React = require('react');
  2. var ReactDOM = require('react-dom');
  3. var SimpleMDEReact = require('../../src/index');
  4. module.exports = React.createClass({
  5. getMarkdownOptions() {
  6. return {
  7. autofocus: false,
  8. spellChecker: true,
  9. initialValue: this.props.value
  10. }
  11. },
  12. render() {
  13. return (
  14. <SimpleMDEReact
  15. onChange={this.props.handleEditorChange}
  16. options={this.getMarkdownOptions()}
  17. label={this.props.label}
  18. value={this.props.value}
  19. extraKeys={this.props.extraKeys}
  20. />
  21. );
  22. }
  23. });