React – why do I need to wrap functions called by useState in an anonymous function? – Reactjs
I have been taking a React performance training course and this code base is used as an example: https://github.com/stevekinney/wordman/blob/main/src/components/application.jsx#L10 When we call the function inside of useState() it is called on every re-render even though the actual value of correctAnswer…