r/javascript • • Aug 27 '15

Stop Using React for EVERYTHING!

https://medium.com/@zackargyle/stop-using-react-for-everything-c8297ac1a644
3 Upvotes

131 comments sorted by

View all comments

7

u/te7ris Aug 27 '15

give me one good reason NOT to use react for everything.

7

u/[deleted] Aug 27 '15

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.

4

u/Shaper_pmp Aug 27 '15

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.

0

u/[deleted] Aug 27 '15

[deleted]

4

u/te7ris Aug 27 '15

What makes you say it is overkill?

0

u/[deleted] Aug 27 '15

[deleted]

3

u/te7ris Aug 27 '15

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).

3

u/dardotardo Aug 27 '15

It's a bit heavy if you're just writing a form with validation. jQuery would easily suffice and have a lot less overhead.

0

u/[deleted] Aug 27 '15

[deleted]

3

u/dardotardo Aug 28 '15

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.

0

u/[deleted] Aug 27 '15

[deleted]

0

u/[deleted] Aug 27 '15

[deleted]

→ More replies (2)

7

u/WishCow Aug 27 '15

5 years ago YUI2/3, and Prototype had tons of popularity, now they are both dead. It's a terrible argument.

→ More replies (4)

9

u/KhalilRavanna Aug 27 '15 edited Aug 27 '15

Increases dev costs for no good reason in a lot of cases

Seems like a very authoritative statement with no evidence or argument to back it up. How does React increase dev costs?

→ More replies (3)

2

u/parlezmoose Aug 28 '15

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.

-1

u/geuis Aug 27 '15
  • search engine reachable content

  • content intended to be embedded in other sites

  • non-js browsers

That's 3.

14

u/daedius Web Components fanboy Aug 27 '15
  • Isomorphic react libraries?

  • iframes?

  • React native?

5

u/KhalilRavanna Aug 27 '15

Also per the first one you can also render react on the server and serve the rendered HTML. No libraries (outside of react) required.

3

u/Poop_is_Food Aug 27 '15

that's what isomorphic means. (yeah it's a pretentious word)

2

u/KhalilRavanna Aug 27 '15

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.

→ More replies (1)
→ More replies (2)

2

u/rq60 Aug 27 '15

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.

→ More replies (1)

0

u/[deleted] Aug 27 '15

[deleted]

→ More replies (2)

4

u/te7ris Aug 27 '15

they are all invalid. You can achieve all 3 w/ react.

→ More replies (21)
→ More replies (1)
→ More replies (9)