0.2.4 • Published 8 years ago

@draft-editor/editor v0.2.4

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

--

Example

// Dependencies
import React from 'react'
import ReactDOM from 'react-dom'

// Editor
import { Editor, Toolbar } from 'draft-editor'

// Module definition
export default class App extends React.Component {

  // Editor state
  state = {
    editor: Editor.create()
  }

  // Update editor state
  update = (editor) =>
    this.setState({ editor })

  // Render
  render = () =>
    <div>
      <Editor state = {this.state.editor} onChange = {this.update} placeholder = 'Click and type…' />
      <Toolbar state = {this.state.editor} onChange = {this.update} />
    </div>

}

// Render to DOM
ReactDOM.render(<App />, container)

--

Documentation

--

Development

$ npm start
$ open http://localhost:3000

--

Publish to NPM

$ npm run [patch, minor, major]

--

Questions

For questions and support please use the Slack. The issues list is exclusively for bug reports and feature requests

--

Changelog

Changelog for each release is documented in the release notes