This is somewhat disingenuous. They give the simple example below:<p><pre><code> $(".fooButton").click(function() {
$.ajax("/update-foos", { method: "POST" });
});
</code></pre>
and then give the "same" example the React treatment, which not only includes third party libraries for fetching, but also managing fetch state, storing data, and connecting to the store, which none of the above does.<p>A better version of React doing the above would be:<p><pre><code> export function FetchDataButton ({ ...buttonProps }) {
const fetchData = useCallback(() => fetch('/update-foos', {method: 'POST'}), [])
// prop drilling for this example only. don't do this normally.
return <button {...buttonProps} onClick={fetchData} />
}
</code></pre>
which does exactly what the initial example does, additionally rendering the actual button, built-in DOM reconciliation, a declarative API, built-in reactivity (meaning you don't have to handle figuring out what gets updated in response to new data), etc etc.<p>Yes, React introduces boilerplate but not as much as this post makes out, and certainly not enough to warrant the "considered harmful" label.<p>> We — all of us — are not mature enough yet for abstractions like React.<p>Not quite. <i>You</i> aren't ready because you haven't learned the basic concepts enough to understand the problems that React is solving.