ReactJs: target.key undefined after method is reached from li rendered by map function
|Added at||2017-01-03 01:01|
I'm currently trying to coding a react app that would do the following: - Create a list of questions from an array using a map function. - Making each list element clickable using a onClick prop - The linked onClick method changes the state in another file with my 'qsChange' prop.
I had a hard time making my list clickable and finally managed following this question: React: trying to add an onClick to a li tag but the click handler function is undefined
However, now I cannot make it so that my variable 'choice' returns a defined value. I would want var choice to be equal to "A ?", "B ?" or "C ?" depending on which
Here's my code:
I am still a newbie, so please be indulgent ;-) I hope I was clear enough.
Ps: I have also tried this guide but it didn't work for me: http://derpturkey.com/react-pass-value-with-onclick/