Simple react code not working in codepen

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?

Set your JS preprocessor to Babel.

Seems to fix it for me.

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

1 Like

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

1 Like