Harry Smith
Harry Smith

Reputation: 1

Editor in Markdown Preview project not working after I downloaded 'Marked'

Trying to make a Markdown Previewer for a freeCodeCamp project. My editor was working fine, but now I can't update the markdown in my state; it's stuck on the placeholder text I wrote. Whenever I try to type in the editor textarea, it sends my cursor to the bottom of the text box. Editor is supposed to just accept an event using a handleChange method, and I cannot figure out why it's not working for the life of me. Worked fine until I downloaded Marked. Here's a link to the CodePen where I'm fiddling with it. The onChange function is pretty standard.handleChange(event) {this.setState({markdown: event.target.value})};

Upvotes: 0

Views: 216

Answers (1)

Harry Smith
Harry Smith

Reputation: 1

Update: found out the problem. Figured out I needed to set the markdown as the defaultValue prop, not the value prop.

Upvotes: 0

Related Questions