Text editor in react challenge

Why is nothing rendering to the page?

https://codepen.io/gladiator_kris/pen/mdJqOyJ?editors=0110

Also in https://codepen.io/freeCodeCamp/pen/GrZVVO?editors=0010 how did stuff from editor convert into the format of previewer?

You have errors in your code.

  1. Line 27: the onChange handler is not surrounded in brackets {}

  2. For the Editor component, you are using the wrong prop name and for Preview you are not using the prop at all.

  3. You need to call marked and use the HTML it returns. Remember that dangerouslySetInnerHTML takes an object with the key __html

<div id="preview" dangerouslySetInnerHTML={{__html:marked(props.markdown)}} />

1 Like

Thank you so much for this :slight_smile: