ReactJS beginner problem | Sololearn: Learn to code for FREE!

+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)

6/10/2020 8:01:12 AM

WARLORD

4 Answers

New Answer

+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

+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.

+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 :)

+1

šŸ”« Rick Grimes thanks but as I mentioned in the question I used Codepen ReactJS editor and neither console and output windows showed anything