Are you first timer at Why not join us and start exchange your programming knowledge with everyone. Register today!

JSX - Syntax

0 votes
added Mar 8 in JSX by LC Marshal Captain (23,940 points)
edited Mar 8 by LC Marshal
// using return

// parentheses need to be use for return that has more than 1 line, to not break the code

// e.g
return <layout/>

return (
  <layout value={this.setState[i]}
  onClick={) => thishandleClicki)}


1 Response

0 votes
responded Mar 8 by LC Marshal Captain (23,940 points)

in HTML, you pass a string as the event handler

<button onclick="activateLink()">
  Activate Link


in React, you pass function instead 

<button onClick={activateLink}>
  Activate Link
</button> - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.