How to use the megadraft.DraftJS.genKey function in megadraft

To help you get started, we’ve selected a few megadraft examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github globocom / megadraft-related-articles-plugin / src / Button.js View on Github external
onClick(e) {
    const data = {articles: [{key: DraftJS.genKey()}], type: constants.PLUGIN_TYPE};
    this.props.onChange(insertDataBlock(this.props.editorState, data));
  }
github globocom / megadraft-related-articles-plugin / src / Block.js View on Github external
_handleAddAnotherClick(event) {
    event.preventDefault();
    this.props.container.updateData(
      {articles: this.props.data.articles.concat({key: DraftJS.genKey()})}
    );
  }