We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fc0298d commit 5e219c3Copy full SHA for 5e219c3
src/SimpleRichTextEditor.js
@@ -66,17 +66,16 @@ export default class SimpleRichTextEditor extends Component {
66
let {format, onChange} = this.props;
67
let oldEditorValue = this.state.editorValue;
68
this.setState({editorValue});
69
- if (onChange == null) {
70
- return;
71
- }
72
let oldContentState = oldEditorValue ? oldEditorValue.getEditorState().getCurrentContent() : null;
73
let newContentState = editorValue.getEditorState().getCurrentContent();
74
if (oldContentState !== newContentState) {
75
let stringValue = editorValue.toString(format);
76
- // Optimization so when onChange passes us new props we don't need
+ // Optimization so if we receive new props we don't need
77
// to parse anything unnecessarily.
78
this._currentValue = [format, stringValue];
79
- onChange(stringValue);
+ if (onChange) {
+ onChange(stringValue);
+ }
80
}
81
82
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments