+ 2

ReactJS beginner problem

I have recently started learning reactjs and I got a problem with this code https://code.sololearn.com/WUuDSZAL30TA/?ref=app I tried it on Codepen and the console didn't show anything and there wasn't any output(of course I used Codepen reactjs setup)

10th Jun 2020, 8:01 AM
WARLORD
WARLORD - avatar
4 Answers
+ 4
WARLORD Idk what is wrong on codepen since you did now show me any link to your codepen code. But I looked into your code and found bunch of mistakes which I fixed here(look in comments, I added what mistakes you did): https://code.sololearn.com/WTrI4lddIVV8/?ref=app
10th Jun 2020, 9:15 AM
Raj Chhatrala
Raj Chhatrala - avatar
+ 3
If you want to use React.js on playground then you need to link cdn to react and other libraries. https://code.sololearn.com/W7smOO5OV0Vn/?ref=app NOTE: you can remove SCSS compiler and cdn if you're not using it.
10th Jun 2020, 8:19 AM
Raj Chhatrala
Raj Chhatrala - avatar
+ 2
đŸ”« Rick Grimes I tried the arrow functions with () around the arguments and it worked when I tried the second time because when tried that on the second time the function worked but not the array Thanks for helping me, and here's a "best answer" have a nice day :)
10th Jun 2020, 9:26 AM
WARLORD
WARLORD - avatar
+ 1
đŸ”« Rick Grimes thanks but as I mentioned in the question I used Codepen ReactJS editor and neither console and output windows showed anything
10th Jun 2020, 9:07 AM
WARLORD
WARLORD - avatar