# Simple react code not working in codepen

**URL:** <https://forum.freecodecamp.org/t/simple-react-code-not-working-in-codepen/412041>\
**Category:** General\
**Created:** [July 27, 2020, 1:48pm UTC](https://forum.freecodecamp.org/t/simple-react-code-not-working-in-codepen/412041 "2020-07-27T13:48:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![baha](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/baha/32/142730_2.png) [@baha](https://forum.freecodecamp.org/u/baha)\
**Post date:** [July 27, 2020, 1:48pm UTC](https://forum.freecodecamp.org/t/simple-react-code-not-working-in-codepen/412041/1 "2020-07-27T13:48:34Z")

</div>

The following project is so simple I think I have wrote it when I first started learning react, it’s showing that there’s a syntax error in Codepen, but I created it locally using create-react-app and it’s working without errors, could you take a look please and tell me if you can figure it out?

> **[My first React code.](https://codepen.io/bahax/pen/pQWzmG?editors=0011)**
>
> ...

---

<div class="post-metadata">

**Author:** ![JacksonBates](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jacksonbates/32/123402_2.png) [@JacksonBates](https://forum.freecodecamp.org/u/JacksonBates)\
**Post date:** [July 27, 2020, 1:59pm UTC](https://forum.freecodecamp.org/t/simple-react-code-not-working-in-codepen/412041/2 "2020-07-27T13:59:27Z")

</div>

Set your JS preprocessor to Babel.

Seems to fix it for me.

Create react app does that automatically for you, if I recall correctly.

---

<div class="post-metadata">

**Author:** ![baha](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/baha/32/142730_2.png) [@baha](https://forum.freecodecamp.org/u/baha)\
**Post date:** [July 27, 2020, 2:01pm UTC](https://forum.freecodecamp.org/t/simple-react-code-not-working-in-codepen/412041/3 "2020-07-27T14:01:33Z")

</div>

Wow it worked! thanks a million, I totally forgot about Babel!

---

<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, 6:45pm UTC](https://forum.freecodecamp.org/t/simple-react-code-not-working-in-codepen/412041/4 "2021-06-01T18:45:24Z")

</div>

Closed on June 1, 2021, 6:45pm UTC


