I am very new to react and I stuck on some idea. The problem I have is that onclick is not firing up.
class Application extends React.Component{
render () {
return (
<div>
<button onClick={alert("hello world")}>Hello Application</button>
</div>
)
}
}
ReactDOM.render(<Application />,document.getElementById("tar"));
I am expecting when the button is clicked, alert saying hello world will be show up. However, that is not happening! Why is that?