WYSIWYG Twitter-like comment editor for react
npm install --save react-slate-small-editor
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}`}
/>
);
}
}
MIT © ntgussoni