I want to use an event handler to redirect a user to another route in reactJS but I have not figured out how i can pass down it's props to the event handler function.
<button onClick={ChallengeActions.OpenChallenge(item.title) }>Start<button>
This is what my event listener looks like
onOpenChallenge: function(url) {
window.location.href = url;
}
The problem is that the function automatically fires up whenever i load the page instead of waiting for the event handler, I also get the following error.
Uncaught Error: Invariant Violation: Expected onClick listener to be a function, instead got type object