Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.renderSource = this.renderSource.bind(this);
const { editorState, rawContentState } = props;
this.state = {
readOnlyState: false,
hasFocus: false,
sourceOptions: null,
};
if (editorState !== null) {
this.getEditorState = this.getEditorStateProp.bind(this);
} else {
// If editorState is not used as a prop, create it in local state from rawContentState.
this.state.editorState = createEditorStateFromRaw(rawContentState);
this.getEditorState = this.getEditorStateState.bind(this);
}
}