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

Commit

Permalink
using newer 'ref' syntax
Browse files Browse the repository at this point in the history
Summary:
*Before* submitting a pull request, please make sure the following is done...

1. Fork the repo and create your branch from `master`.
2. If you've added code that should be tested, add tests!
3. If you've changed APIs, update the documentation.
4. Ensure that:
  * The test suite passes (`npm test`)
  * Your code lints (`npm run lint`) and passes Flow (`npm run flow`)
  * You have followed the [testing guidelines](https://github.com/facebook/draft-js/wiki/Testing-for-Pull-Requests)
5. If you haven't already, complete the [CLA](https://code.facebook.com/cla).

Please use the simple form below as a guideline for describing your pull request.

Thanks for contributing to Draft.js!

-

**Summary**

[...]

**Test Plan**

[...]
Closes #925

Differential Revision: D5442872

fbshipit-source-id: a99321f173a3cb64fe01b83360dbe7f30cbe8adc
  • Loading branch information
mks11 authored and facebook-github-bot committed Jul 18, 2017
1 parent 89260c0 commit 82bbec3
Showing 1 changed file with 7 additions and 4 deletions.
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

0 comments on commit 82bbec3

Please sign in to comment.