react errors BEGINNER
Answered
bobonlan posted this in #help-forum
![Avatar](https://cdn.discordapp.com/avatars/201616033805500416/f5511864187e7f9131a2582d9c7b2832.webp?size=256)
bobonlanOP
following along with a mosh course and getting some errors but don't understand why, any insight would be helpful.
19 Replies
![Avatar](https://cdn.discordapp.com/avatars/201616033805500416/f5511864187e7f9131a2582d9c7b2832.webp?size=256)
bobonlanOP
![Image](https://cdn.discordapp.com/attachments/1147844816403710002/1147844895600553994/image.png)
![Avatar](https://cdn.discordapp.com/avatars/484037068239142956/f386ac21405ce3442e0f3598223e1cb3.webp?size=256)
joulev
Can you show the ListGroup.tsx file
![Avatar](https://cdn.discordapp.com/avatars/201616033805500416/f5511864187e7f9131a2582d9c7b2832.webp?size=256)
bobonlanOP
ye
![Image](https://cdn.discordapp.com/attachments/1147844816403710002/1147845092103684097/image.png)
![Avatar](https://cdn.discordapp.com/avatars/484037068239142956/f386ac21405ce3442e0f3598223e1cb3.webp?size=256)
joulev
Hmm it looks fine to me
what happens if you move the items array outside the ListGroup component
![:thinkies:](https://cdn.discordapp.com/emojis/735597282182824037.png)
![Avatar](https://cdn.discordapp.com/avatars/201616033805500416/f5511864187e7f9131a2582d9c7b2832.webp?size=256)
bobonlanOP
I'm not sure how to do that
im sorry im embarassingly new
![Avatar](https://cdn.discordapp.com/avatars/484037068239142956/f386ac21405ce3442e0f3598223e1cb3.webp?size=256)
joulev
let items = […]
function ListGroup() {
…
}
function ListGroup() {
…
}
![Avatar](https://cdn.discordapp.com/avatars/201616033805500416/f5511864187e7f9131a2582d9c7b2832.webp?size=256)
bobonlanOP
oh
![Avatar](https://cdn.discordapp.com/avatars/484037068239142956/f386ac21405ce3442e0f3598223e1cb3.webp?size=256)
joulev
If it doesn’t work then can you make a code sandbox or something
![Avatar](https://cdn.discordapp.com/avatars/484037068239142956/f386ac21405ce3442e0f3598223e1cb3.webp?size=256)
joulev
Because your code above looks fine to me
Answer
![Avatar](https://cdn.discordapp.com/avatars/201616033805500416/f5511864187e7f9131a2582d9c7b2832.webp?size=256)
bobonlanOP
that fixed it
i just don't understand, usually bugs make sense logically
at least in my experience every "bug" has been some sort of fuck up on my part or not knowing thers better ways to code
![Avatar](https://cdn.discordapp.com/avatars/484037068239142956/f386ac21405ce3442e0f3598223e1cb3.webp?size=256)
joulev
I think it’s strange as well, keys are strings so it should work
![Avatar](https://cdn.discordapp.com/avatars/201616033805500416/f5511864187e7f9131a2582d9c7b2832.webp?size=256)
bobonlanOP
i went along with the next step and it's giving more errors after adding an onClick event to the <li>
The onClick event is working though
![Image](https://cdn.discordapp.com/attachments/1147844816403710002/1147847584577241128/image.png)
nvm refresh fixed it, and 10 seconds later they address that error