Skip to content

truestbyheart/simplex-react-editor

Repository files navigation

simple-react-editor

A simple stackoverflow inspired editor.

NPM JavaScript Style Guide

Install

npm install --save simple-react-editor

Usage

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} />;
  }
}

Update functionality

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}/>;
  }
}

License

MIT © truestbyheart

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published