Why won't drum machine test 7 work?!?!

Hello, for the sake of my sanity can anybody help me with this drum machine challenge in the front end development libraries course please?

I have been working at it on and off for what seems like a lifetime (ok maybe a couple of weeks!!) and I’ve learned loads about React on the way. So not a waste of time. I now have a machine that seems to do everything it is supposed to, but it won’t accept the 7th test, even though it does show a unique string in the display for each button clicked. I’m flummoxed as to what the problem is. Here is my codepen, I would much appreciate any suggestions :slight_smile:

Drum machine (codepen.io)

Thanks.

It looks like it wants you to use inner html to show display. I havent looked thru whole code but im not seeing inner html off the bat. Does that help?

It seems to be the key value on the buttons. They are changing on each render.

Rules of keys

  • Keys must be unique among siblings. However, it’s okay to use the same keys for JSX nodes in different arrays.
  • Keys must not change or that defeats their purpose! Don’t generate them while rendering.

Oh my word - THAT WORKED!! Of course now you say it, I had the key changing each time… You have my undying gratitude :nerd_face:

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