News for hackers. Stuff that matters.
Re:My struggle to learn React by tracker1 on Wednesday May 09, 2018 @03:55PM (#17033383)
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.

There are no comments on this comment yet.