Dev learning. I don't think anyone thinks about this form a business perspective. Constantly changing these frameworks with newer technologies is great and fun for an engineering perspective. However if the business doesn't want to invest in this or you are breaking features it's going to be a much larger cost. React is a view I have other options for that view and I can still use es6. Most all the components needed for react as a whole can be used in other frameworks easily. You can add flux to angular if you wanted or anything else.
Because you should choose the best tool for each job, not pick one tool, fall in love with it and then bend and mangle every set of requirements you run across until they're mutilated enough from their original intent to conveniently fit your tool.
You don't use React for everything for the same reason you carry a whole toolbox instead of a hammer - because if you don't then eventually you find yourself hammering in screws and trying to nail bits of paper together, and then you've slipped from being a professional developer and turned into a halfwit liability to any project you encounter.
mother fucking website is not really a website. Its a single document. If you have no internal links you have no benefit using react. If you had to do it in react you would create a single component and render it, which would indeed add some boilerplate.
React shines when you have a website with atleast 2 pages. Becuase you get a SPA w/ serverside rendering for free (try building this w/o react).
Library size isn't the only issue, cdn delivery takes care of that considering pretty much every site uses jQuery a lot less use react. The other thing is the code required for doing something this simple in jQuery would be smaller than react, plus use a lot less browser overhead for loading up the shadow dom.
Honestly I feel like updating react would be way easier than most other libraries. Their api is tiny. They go out of their way to force you to use native javascript when they could have very easily introduced all kinds of clever abstractions on top of it. In fact this often makes React very verbose to write.
It's ironic that the so called "purists" are against react when it is in fact a very minimalist framework that favors raw javascript.
Righto-- isomorphic running the same code on both front/back end-- I just meant to point out that there are no 3rd party libraries required and that react does this out of the box.
I used iframes the first time I needed to embed a "widget" in another site; it worked out terribly thanks to mobile safari's awesome bugs. I'll stick to javascript DOM insertion and hopefully web components in the future, thanks.
7
u/te7ris Aug 27 '15
give me one good reason NOT to use react for everything.