Socket
Socket
Sign inDemoInstall

draft-js-undo-plugin

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

draft-js-undo-plugin

Undo Plugin for DraftJS


Version published
Maintainers
1
Created
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 get the UndoButton and the RedoButton components from the instance:

const { UndoButton, RedoButton } = undoPlugin;

Which take two props, onChange (a function that takes a new editor state as an argument and updates your editor's 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

Package last updated on 23 Mar 2016

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc