Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

using newer 'ref' syntax #925

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions examples/draft-0-10-0/plaintext/plaintext.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,15 @@
constructor(props) {
super(props);
this.state = {editorState: EditorState.createEmpty()};

this.focus = () => this.refs.editor.focus();
this.onChange = (editorState) => this.setState({editorState});
this.logState = () => console.log(this.state.editorState.toJS());
this.setDomEditorRef = ref => this.domEditor = ref;
}


componentDidMount(){
this.domEditor.focus()
}

render() {
return (
<div style={styles.root}>
Expand All @@ -49,7 +52,7 @@
editorState={this.state.editorState}
onChange={this.onChange}
placeholder="Enter some text..."
ref="editor"
ref={this.setDomEditorRef}
/>
</div>
<input
Expand Down