Getting react to work in codepen

Can´t seem to get it to work here. Any ideas?

Try adding React to your project in the settings like I did here:

Note, I moved some JS code around

Thank you, but that doesn´t seem to be working either (or at least it´s not loading in my browser).

Well you don’t have an App component yet.

Not sure what you mean. I did finish the App and it runs if I start with npm start, but don´t know what else I should paste in the Codepen.

Have a look at how I did mine:

1 Like

Thank you for the answer. Do I have to do that because I built my project using create-react-app?

Sorry if I´m being annoying. I just don´t understand why other Pens do work when building classes (and pasting the React code without importing anything, like Johnny´s) and mine doesn´t. I fail to see the difference.

It´s finally working! Thanks everyone.