I have a form on my react app. I want to capture the input from the form from my users and store the text in a state property and then send the text back to my server. I have followed the basic DraftJS tutorial however it gives me a map in my state, instead of just the text needed to send back to the server.
constructor(props) {
super(props);
this.state = {
name: '',
teamName: '',
editorState: EditorState.createEmpty(),
teamId: '',
uploadedFileCloudinaryUrl: ''
};
this.handleChange = this.handleChange.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
this.onChange = (editorState) => this.setState({ editorState });
}
<Editor editorState={this.state.editorState} onChange={this.onChange} />
Is there something special I have to do to get the text from the editor?