I’m working on the markdown preview project for the front-end library certificate. I have a textarea element that is set to a placeholder value and onChange, I’m calling handleChange which should set state to e.target.value but when I type in there, it doesn’t allow me to change the value. here a codepen link to the project: https://codepen.io/dmoneyballer/pen/gqEemy?editors=0010
Am I not handling the event correctly? or am I implementing the textArea in editor wrong? any suggestions would help. Thanks
1 Like
You sent the onChange
prop on Editor
as: this.state.handleChange
(line 19).
You should remove the state
keyword. Is not on your state, is just on: this.handleChange
.
So basically it will become:
<Editor placeholder={this.state.markdown} onChange={this.handleChange} />
1 Like
that was it, thanks for the help
1 Like