Drum Machine Tests 2022

I have completed the Drum Machine coding in react using vs code and it passes all of the FCC test suite on my pc .
When I paste the code into codepen my code fails all of the tests.
I have added Babel and the external urls for react. The code fails all of the tests. Any advice on how to get the code running in codepen ?

lDrum Machine

What version of React are you using locally?

Your code is not even showing anything on the page. You can look at your browser console for more info. You will need to use dev cdn url version of React instead of the production version to see more details of what the issues are.

EDIT: Since you are using CDNs in the Codepen JS external links section, you should not use the import part here as it results in two imports of React.

What you need to do instead is:

const { useState, useEffect } = React;
const { createRoot } = ReactDOM;

You will still receive an error in the browser console because you can not use class as you are doing for the h2 element. Also, you should change the h2 to be h1 as there needs to be an h1 before you use an h2 on a page.

1 Like

Thank you for your help. Passes all the test now and no error messages