Search code examples
reactjscodepenreact-spring

How do I set up React-spring in codepen?


I tried to create a basic setup to start practicing react-spring in CodePen, but it shows an error: Uncaught ReferenceError: require is not defined. I don't know why this happens and how to fix it.

This is the code of my app so far (as you can seee, it's super short):

https://codepen.io/Nerdifico/pen/oNxXNPv?editors=0010

Thanks in advance!

enter image description here


Solution

  • Codesandbox maybe an easier option. Here is an example: https://codesandbox.io/s/jn3z28ry33