🤔 codepen issue

My code works well on my editor, why I can’t see anything on codepen?

User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:89.0) Gecko/20100101 Firefox/89.0

Challenge: Build a Drum Machine

If you look in the Settings > JS at the bottom there is “Add Packages” you can use for imports. Also, import React from, { useRef } 'react' is not valid, it should be import React, { useRef } from 'react';

import React, { useRef } from "https://cdn.skypack.dev/react@17.0.1";
import ReactDOM from "https://cdn.skypack.dev/react-dom@17.0.1";

BTW, for React I would suggest using CodeSandbox instead of Codepen.

1 Like

:rofl:

I was tired

thank you

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.