From e088366364b6abfdac508418447b7e68c82d9e95 Mon Sep 17 00:00:00 2001 From: Ian Storm Taylor Date: Mon, 25 Jul 2016 17:04:10 -0700 Subject: [PATCH] cleanup editor and content props --- lib/components/content.js | 16 +++++++--------- lib/components/editor.js | 5 ++++- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/components/content.js b/lib/components/content.js index 18e7e1191..4b43d65bb 100644 --- a/lib/components/content.js +++ b/lib/components/content.js @@ -36,15 +36,15 @@ class Content extends React.Component { static propTypes = { className: React.PropTypes.string, editor: React.PropTypes.object.isRequired, - onBeforeInput: React.PropTypes.func, - onChange: React.PropTypes.func, - onKeyDown: React.PropTypes.func, - onPaste: React.PropTypes.func, - onSelect: React.PropTypes.func, - readOnly: React.PropTypes.bool, + onBeforeInput: React.PropTypes.func.isRequired, + onChange: React.PropTypes.func.isRequired, + onKeyDown: React.PropTypes.func.isRequired, + onPaste: React.PropTypes.func.isRequired, + onSelect: React.PropTypes.func.isRequired, + readOnly: React.PropTypes.bool.isRequired, renderMark: React.PropTypes.func.isRequired, renderNode: React.PropTypes.func.isRequired, - spellCheck: React.PropTypes.bool, + spellCheck: React.PropTypes.bool.isRequired, state: React.PropTypes.object.isRequired, style: React.PropTypes.object }; @@ -56,8 +56,6 @@ class Content extends React.Component { */ static defaultProps = { - readOnly: false, - spellCheck: true, style: {} }; diff --git a/lib/components/editor.js b/lib/components/editor.js index 286b11d32..3e2e5647c 100644 --- a/lib/components/editor.js +++ b/lib/components/editor.js @@ -38,6 +38,7 @@ class Editor extends React.Component { renderDecorations: React.PropTypes.func, renderMark: React.PropTypes.func, renderNode: React.PropTypes.func, + spellCheck: React.PropTypes.bool, state: React.PropTypes.object.isRequired, style: React.PropTypes.object }; @@ -46,7 +47,8 @@ class Editor extends React.Component { onDocumentChange: noop, onSelectionChange: noop, plugins: [], - readOnly: false + readOnly: false, + spellCheck: true }; /** @@ -232,6 +234,7 @@ class Editor extends React.Component { readOnly={this.props.readOnly} renderMark={this.renderMark} renderNode={this.renderNode} + spellCheck={this.props.spellCheck} state={this.state.state} style={this.props.style} />