Created
November 21, 2017 19:10
-
-
Save laynor/3eb041f4c69f021b0952512cb4ecf576 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PlainText extends React.Component { | |
state = { | |
value: Plain.deserialize('This is editable plain text, just like a <textarea>!') | |
} | |
onChange = ({ value }) => { | |
this.setState({ value }); | |
} | |
render() { | |
return ( | |
<div className="editor"> | |
<Editor | |
placeholder="Enter some plain text..." | |
value={this.state.value} | |
onChange={this.onChange} | |
/> | |
</div> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment