DEV Community

Discussion on: Stop Using React

Collapse
 
aleksandrhovhannisyan profile image
Info Comment hidden by post author - thread only visible in this permalink
Aleksandr Hovhannisyan

I genuinely can't tell if this is a troll article.

The Internet is a stream. React is not. I see it like this: React fights against the natural flow of the Internet.

Ditch React and become friends with the web. It's a web, interconnected, with resources coming from everywhere. Web apps are not like native apps that take 30 seconds to download before the user accesses the content. Stop treating webpages like native apps.

This... is the dumbest thing I've ever read. What does it even mean? Stream? What?

React is just a wrapper API around the native DOM. So is the native DOM fighting against the natural flow of the internet, too? Or JavaScript?

Point #5 is even stupider. Do you propose we also stop using GitHub, Twitter, and Google? Major corporations are always caught up in lawsuits. That means nothing (usually).

Collapse
 
ender_minyard profile image
ender minyard • Edited

This is what a stream is. I hope that clarifies things for you.

As for your point in regards to #5: This is the slippery slope fallacy you are engaging in.

Collapse
 
aleksandrhovhannisyan profile image
Aleksandr Hovhannisyan

This is what a stream is. I hope that clarifies things for you.

No... no it doesn't. This has nothing to do with what React is or is not.

React is built with JavaScript and just wraps native DOM operations. It's a layer of abstraction on top of existing APIs.

You said:

Ditch React and become friends with the web. It's a web, interconnected, with resources coming from everywhere.

Are you aware that there are "resources coming from everywhere" in React apps too? Have you ever examined the output of a React app with your dev tools? Or inspected your network tab? Anything that React does can be done with the native DOM, but with much greater complexity.

As for your point in regards to #5: This is the slippery slope fallacy you are engaging in.

It's not a slippery slope to suggest that we do exactly what you proposed: to stop using a product belonging to a company that has been sued (Facebook). So, I ask: Why are you selectively boycotting React but not any other products created by other companies that have been sued?

Ironically, you are engaging in argument from fallacy.

Thread Thread
 
ender_minyard profile image
ender minyard • Edited
No... no it doesn't. This has nothing to do with what React is or is not.
What does it even mean? Stream? What?

You were confused by what a stream is, so I shared some helpful links.

React is just a wrapper API around the native DOM. So is the native DOM fighting against the natural flow of the internet, too? Or JavaScript?

React downloads all resources for a SPA at once. React needs to download resources for seconds at a time, blocking the main thread. Read the article again, perhaps?

Thread Thread
 
matthewpardini profile image
Matthew Pardini

Dude... react doesn’t do that. And the internet is NOT a readable stream. In fact, 99% of all resources are loaded NOT as streams which come off the response.body(), which you must attach a stream reader to in order to read the stream.

This is painful. Client side rendered apps will hit the browser, and turn around and go back to a server for the javascript bundle. That is true, unless you do ssr, in which case the react app hits the browser with the first view already built as html.

AFTER the first screen is built, the react code then turns around and makes more calls to “lazy load” the rest. In older react, it was handled in componentDidMount. Today it’s done in useEffect(). These run AFTER the first render.

It’s obvious you don’t know a lick about react

Collapse
 
steveruizok profile image
Steve Ruiz

I think the OP’s issue is with downloading the whole single page app as an upfront bundle vs. downloading the resources for just one page of the site. It’s an argument against SPAs (or Create React App) rather than React itself: there are plenty of frameworks like Next.js that allow you to use React to author static sites. You can also use React to render just parts of a page rather than the entire site.

React is fine. Using React is fine. A better argument would be: if your site doesn’t need to be a single page app, try to make it a static site. If it does need to be a single page app, do what you can to reduce the bundle size, including using other lightweight frameworks.

Collapse
 
ender_minyard profile image
ender minyard

Some comments have been hidden by the post's author - find out more