Skip to content

ntgussoni/react-slate-small-editor

Repository files navigation

react-slate-small-editor

WYSIWYG Twitter-like comment editor for react

NPM JavaScript Style Guide

WORK IN PROGRESS

Install

npm install --save react-slate-small-editor

Usage

import React, { Component } from "react";
import { ReactSlateSmallEditor } from "react-slate-small-editor";

class Example extends Component {
  state = {
    value: null
  };

  onChange = value => {
    this.setState({ value });
  };

  render() {
    return (
      <ReactSlateSmallEditor
        onChange={this.onChange}
        value={value}
        onFileSelected={async file => upload(file)}
        maxCharacterCount={maxCharacterCount}
        renderCount={count => `${count} / ${maxCharacterCount}`}
      />
    );
  }
}

License

MIT © ntgussoni