diff --git a/lib/components/TinyMCE.js b/lib/components/TinyMCE.js index eb778e9..3302c93 100644 --- a/lib/components/TinyMCE.js +++ b/lib/components/TinyMCE.js @@ -105,10 +105,11 @@ const TinyMCE = React.createClass({ config.selector = '#' + this.id; config.setup = (editor) => { EVENTS.forEach((event, index) => { - const handler = this.props[HANDLER_NAMES[index]]; - if (typeof handler !== 'function') return; + if (!this.props[HANDLER_NAMES[index]]) return; editor.on(event, (e) => { // native DOM events don't have access to the editor so we pass it here + const handler = this.props[HANDLER_NAMES[index]]; + if (typeof handler !== 'function') return; handler(e, editor); }); });