Socket
Socket
Sign inDemoInstall

draft-js-undo-plugin

Package Overview
Dependencies
27
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    draft-js-undo-plugin

Undo Plugin for DraftJS


Version published
Weekly downloads
208
decreased by-53.15%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

History Plugin

This is a plugin for the draft-js-plugins-editor.

This plugin adds undo/redo functionality to your editor!

Usage

First instantiate the plugin:

import createUndoPlugin from 'draft-js-undo-plugin';

const undoPlugin = createUndoPlugin();

Now import the UndoButton and the RedoButton from the instance:

import { UndoButton, RedoButton } from undoPlugin;

Which take two props, onChange (a function that takes a new editor state as an argument and updates your editors state) and editorState (the current editor state). Render them with those props and your editor now has undo/redo functionality!

<UndoButton onChange={ this.onChange } editorState={ this.state.editorState } />
<RedoButton onChange={ this.onChange } editorState={ this.state.editorState } />

Keywords

FAQs

Last updated on 22 Mar 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc