You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The default change listener for the editor is NOOP, implying that it's optional. If you don't supply a change listener then the displayed text in the editor doesn't change when you type. In practice, you must supply a change listener, which updates the editor's value prop on change.
The text was updated successfully, but these errors were encountered:
Here, the text 'Hello World' cannot be changed in the editor.
<MarkdownEditorvalue={"Hello World"}/>
Setting the value from component state and adding a change listener allows text to be edited:
classHelloWorldextendsReact.component{constructor(){this.state={value: 'Hello World'};}onChange(e){const{ value }=e.target;this.setState({ value });}render(){<MarkdownEditoronChange={this.onChange.bind(this)}value={this.state.value}/>}}
The default change listener for the editor is
NOOP
, implying that it's optional. If you don't supply a change listener then the displayed text in the editor doesn't change when you type. In practice, you must supply a change listener, which updates the editor'svalue
prop on change.The text was updated successfully, but these errors were encountered: