diff --git a/packages/slate-react/src/components/editor.js b/packages/slate-react/src/components/editor.js index 992fd0233..b4502043b 100644 --- a/packages/slate-react/src/components/editor.js +++ b/packages/slate-react/src/components/editor.js @@ -145,7 +145,15 @@ class Editor extends React.Component { // Re-resolve the controller if needed based on memoized props. const { commands, placeholder, plugins, queries, schema } = this.props - this.resolveController(plugins, schema, commands, queries, placeholder) + + this.resolveController( + plugins, + schema, + commands, + queries, + placeholder, + ReactPlugin + ) // Set the current props on the controller. const { options, readOnly, value: valueFromProps } = this.props @@ -208,7 +216,7 @@ class Editor extends React.Component { */ resolveController = memoizeOne( - (plugins = [], schema, commands, queries, placeholder) => { + (plugins = [], schema, commands, queries, placeholder, TheReactPlugin) => { // If we've resolved a few times already, and it's exactly in line with // the updates, then warn the user that they may be doing something wrong. warning( @@ -217,7 +225,7 @@ class Editor extends React.Component { ) this.tmp.resolves++ - const react = ReactPlugin({ + const react = TheReactPlugin({ ...this.props, editor: this, value: this.props.value || this.state.value,