Hacker News new | ask | show | jobs
by tracker1 2964 days ago
I don't think so...

   <button class="MyButton" onclick="doSomeJsStuff()">...</button>
   <script>function doSomeJsStuff() { ... }</script>
vs

    function MyButton(props) {
      return <button className="MyButton" onClick={this.props.onClick}>
        {props.children}
      </button>
    }
The latter is a reusable component, the former is a one-off that has to be repeated over and over instead of re-used. Both wrap one syntax into another.