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

Show parent comments

3

u/te7ris Aug 27 '15

the projects I work on for my employer (3 days a week) dont use react (they have their own stack). The rest of my time I spend on developing a pretty big react project which is not yet in production. Had 2 small React projects (SPAs for interal stuff) before that.

1

u/MisterSticks Aug 28 '15

React hasn't been in the wild for more than a year, do you have any personal projects that predate React?

2

u/te7ris Aug 28 '15

I first picked up react dec 14' and had tried various things with it. The most frustrating was trying to combine libs that havily change the DOM with the react-render-cycle. Why are you asking?

1

u/theQuandary Aug 28 '15

That's still a rather easy solution compared to quite a number of frameworks.

When your component mounts into the DOM, you then wire in whatever DOM-manipulating library you're using to the local DOM element(s). To prevent React from interfering, you use shouldComponentUpdate to trap and handle any data updates and return false (so no re-render). In the componentWillUnmount stage, you unwire whatever you're using.

Two and a half out of three of those are things you'd need to be doing anyway. The only major change is returning false to prevent re-rendering.

1

u/te7ris Aug 28 '15

Yeah I know that but I had that experiment where I wanted to combine both worlds. I wanted to use the react-rendering and the DOM-manipulation of the lib.

Imagen multiple React-Components nested into eachother and one 3rd-Party lib that potentially manipulates any of the DOM.

1

u/theQuandary Aug 28 '15

I see what you're saying, but even CRUD apps that are rendered server-side can't usually deal with the idea that you'll modify any number of templates. That is asking for major breakages on pretty much any non-trivial website. Even without React there's a need to isolate your side effects to something manageable.

-2

u/Ahri Aug 27 '15

So "nowhere", then?