# Text editor in react challenge

**URL:** <https://forum.freecodecamp.org/t/text-editor-in-react-challenge/356789>\
**Category:** General\
**Created:** [March 7, 2020, 7:06pm UTC](https://forum.freecodecamp.org/t/text-editor-in-react-challenge/356789 "2020-03-07T19:06:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gladiator-kris](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/gladiator-kris/32/133666_2.png) [@gladiator-kris](https://forum.freecodecamp.org/u/gladiator-kris)\
**Post date:** [March 7, 2020, 7:06pm UTC](https://forum.freecodecamp.org/t/text-editor-in-react-challenge/356789/1 "2020-03-07T19:06:25Z")

</div>

Why is nothing rendering to the page?

[https://codepen.io/gladiator\_kris/pen/mdJqOyJ?editors=0110](https://codepen.io/gladiator_kris/pen/mdJqOyJ?editors=0110)

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

---

<div class="post-metadata">

**Author:** ![lasjorg](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/lasjorg/32/280761_2.png) [@lasjorg](https://forum.freecodecamp.org/u/lasjorg)\
**Post date:** [March 7, 2020, 7:32pm UTC](https://forum.freecodecamp.org/t/text-editor-in-react-challenge/356789/2 "2020-03-07T19:32:25Z")

</div>

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](https://marked.js.org/#/README.md#usage) and [use the HTML](https://reactjs.org/docs/dom-elements.html#dangerouslysetinnerhtml) it returns. Remember that `dangerouslySetInnerHTML` takes an object with the key `__html`

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

---

<div class="post-metadata">

**Author:** ![gladiator-kris](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/gladiator-kris/32/133666_2.png) [@gladiator-kris](https://forum.freecodecamp.org/u/gladiator-kris)\
**Post date:** [March 8, 2020, 3:20am UTC](https://forum.freecodecamp.org/t/text-editor-in-react-challenge/356789/3 "2020-03-08T03:20:02Z")

</div>

Thank you so much for this 🙂

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [June 1, 2021, 7:33pm UTC](https://forum.freecodecamp.org/t/text-editor-in-react-challenge/356789/4 "2021-06-01T19:33:21Z")

</div>

Closed on June 1, 2021, 7:33pm UTC


