Onclick is not calling a function? This is how you fix it.

This is what I had originally:

onClick={submitAnswer(task)}

 

This is how you need to change it.

onClick={()=>{submitAnswer(task)}}

 

Hope that helps.