const templateTwo = (
<div>
<h1>Count :{count}</h1>
<button className="button" onClick={minusOne}>-1</button>
<button onClick={function name() {
console.log("nnn")
}}>Reset</button>
</div>
)
1) According to the JSX
You can put any valid JavaScript expression inside the curly braces in JSX.
2) but while reading docs for eventHandler in React i came across the following
JSX you pass a function as the event handler, rather than a string.
3) Until here everyThing looks great but now in my above code i had used functional statement as EventHandler but it worked i am confused as per docs we have to use functional expressions inside {}
4) How it worked can we use functional statments inside {} (in jsx )