Skip to content

Commit 7735bcd

Browse files
committed
createPluginHooks improvements
only needs to call `createEventHooks` or `createFnHooks` once for the given `attrName` ?
1 parent 93241e0 commit 7735bcd

File tree

1 file changed

+1
-1
lines changed
  • draft-js-plugins-editor/src/Editor

1 file changed

+1
-1
lines changed

draft-js-plugins-editor/src/Editor/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class PluginEditor extends Component {
9696

9797
plugins.forEach((plugin) => {
9898
Object.keys(plugin).forEach((attrName) => {
99-
if (attrName === 'onChange') return;
99+
if (pluginHooks[attrName] || attrName === 'onChange') return;
100100

101101
if (attrName.indexOf('on') === 0 || attrName.indexOf('handle') === 0) {
102102
pluginHooks[attrName] = this.createEventHooks(attrName, plugins);

0 commit comments

Comments
 (0)