I'm new to React and Codepen but just started trying it out. Somehow the examples that I copied from elsewhere that I know should work doesn't give me anything in Codepen. Thought I must've set up things wrong I ended up forking other people's code on Codepen and trying my code there and it still doesn't work.
Here's an example of what I'm trying: https://codepen.io/hensy8586/pen/MWyoGLR. It's a simple code that should return three clickable buttons but I see nothing in the output window other than blank, and I'm not getting any error messages.
There are a few other error messages I encountered that confuse me:
- I've also seen (sometimes) an error message saying I should import React and ReactDOM but I've seen plenty other codes that work without one.
- I also encountered error that says
Uncaught ReferenceError: require is not defined, which goes away after I add require.js script. But I've noticed many other code in Codepen that runs okay without require.js added.
I appreciate if someone can help me understand these better. Thanks.