Why can't I pass a value to a method with onClick in React?
I’m trying to pass a value to a method in React using the onClick event, but it doesn’t seem to work as expected. I either get errors or the method executes immediately instead of waiting for the click. What’s the correct way to pass values in this scenario?