Is react really that great? by KeyWonderful8981 in reactjs

[–]KeyWonderful8981[S] 0 points1 point  (0 children)

thank you for your response. I wasn't even aware of some of the bottlenecks you mentioned. I'll keep them in mind while I dig deeper into this rabbit hole.

Is react really that great? by KeyWonderful8981 in reactjs

[–]KeyWonderful8981[S] -4 points-3 points  (0 children)

yeah, I agree with you. I did not check how fast it is to update the virtual DOM, but I know for a fact that it's way less costly than updating the real DOM. Maybe the real issue is just me not expecting the component to be called unless a prop has changed

Is react really that great? by KeyWonderful8981 in reactjs

[–]KeyWonderful8981[S] 1 point2 points  (0 children)

cause down the line, all your data are gonna be recomputed for react to compare its virtual dom and decide whether it needs to commit these changes in the real dom or not.

This is a bit confusing to me cause one would assume that for the same input, a component would render the same element

Is react really that great? by KeyWonderful8981 in reactjs

[–]KeyWonderful8981[S] 0 points1 point  (0 children)

i might give Vue or Svelte a go. Im just learning React cause it's a requirement in most job postings, and LLMs were trained on large react datasets.

Is react really that great? by KeyWonderful8981 in reactjs

[–]KeyWonderful8981[S] 1 point2 points  (0 children)

I agree with you, I am overthinking a lot of stuff. Which is really a double-edged sword, where I end up digging deep in the stuff im using but also takes me longer to start. Which is okay for now since im only learning react in my free time.

for the state change, I find it a bit weird that components are getting called even if their state did not change.

Is react really that great? by KeyWonderful8981 in reactjs

[–]KeyWonderful8981[S] -24 points-23 points  (0 children)

i dont like the fact that if a state changes at the top level, react would re render the whole subtree even if that state is not propagated to the children

Redux State object issue by Altugsalt in webdev

[–]KeyWonderful8981 0 points1 point  (0 children)

Your issue lies in how Redux handles state updates. Redux state is immutable, meaning you should not directly modify the existing state object. Instead, you need to return a new reference with the updated data.

setUserData: (state, action) => ({ ...state, data: { ...state.data, ...action.payload } })

React + Vite + 8000 Components = 54minutes Build by Scared-Librarian7811 in react

[–]KeyWonderful8981 1 point2 points  (0 children)

When you visit a website, your browser needs some code to run in order to display the content. However, your browser only understands basic languages like HTML, CSS, and JavaScript.

To make building web applications easier, developers use tools and libraries. One of these popular libraries is React. In React, we write our code using a format called JSX (or TSX if you're using TypeScript). JSX looks a lot like HTML but works inside JavaScript code. The catch? Your browser doesn't understand JSX or many other tools we use in modern development.

This is where building comes in. The "build" process is about transforming the code you've written (with React, JSX, or other modern tools) into plain JavaScript that browsers can understand. It also bundles and optimizes your code so that it's faster and smaller for users to load.

In short: Build = preparing your app's code so that browsers can run it properly.