2 ms·
I don't think so... <button class="MyButton" onclick="doSomeJsStuff()">...</button> <script>function doSomeJsStuff() { ... }</script> vs function M
by tracker1 9y 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.