What is the need of redux in react? [closed] - reactjs

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
When we have component to write all logic then why we use redux. As we can separate template and styling from component

In the simplest words, you need redux for very complex state management in a large project. When you work on a large production level project, there are several components and states to worry about, and passing components between states becomes a mess. You could use context but in many cases you may need to move state up by 1 or more components to be able to use it effectively. This kind of problem is what redux aims to solve, and you will not be able to appreciate unless you work on a large project where components depend on other component's states.

Related

What is the most effective way of State Management in Enterprise level React Application [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 months ago.
Improve this question
I am totally confused about how to manage the application level state in React.
I have an enterprise-level application frontend that has some data that is used across application.
Should I use Redux or react hooks or my own JavaScript code that manages the state?
If you are going to need to share the state across a lot of components then you could use either Redux or useContext hook (more Simpler and easy to understand than Redux).
If you have a lot of data (configurations etc) to be shared by multiple components on different hierarchy levels then I will recommend you to use redux-toolkit

What should I use to pass data to other component. React Hooks or Context API or Redux or prop drilling. Which one will be better for performance [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 10 months ago.
Improve this question
I can pass data to other REACT component using React Hooks, Context API and Prop Drilling. Would it be wise to learn about Redux to manage my state as well as use it to pass my data to other component performance wise.
That actually depends on your use case. With hooks, context API you can achieve almost anything

Which is the best option? Use an unupdated component in React or try to implement the library in react without the component? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I have found some components that are not updated with the last React version, however, those components work. But I was wondering if those components are not updated would be the best option or a good practice to try to implement the libraries in React without the npm packages?
Thanks.
I'm my experience, it'll depend upon the product you're working on. IE. you're working in a UI that is not likely changing and once it's done, it'll remain the same for some time (rare case), and it's not too complex. I'd go for the component even if it's not that updated.
If the benefits from constructing the component yourself (long term maintainability, extensibility, etc.) are important to your project and it won't take that much time, maybe it'll be the best option.

Does react suggest, how many nested component should be used in an application? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
Is creating more than 3 levels of nested components in react a bad practice? If yes, what are other ways to create complex UI without diluting a component's responsibility?
No but if they have lots of props passing down to each other then it is.
solution is:
REDUX! Or React Context Api
creates a global state container. so components can be decoupled from each other
https://redux.js.org/
The levels of nested components doesn't matter anymore than the level of nested HTML elements matters.
If on the other hand you're passing props more than 3-4 levels deep, that is not recommended. React's Context API was created to solve that. It helps you setup Provider/Consumer pairs that can inject props at any level. Here's a good example from React docs:
https://reactjs.org/docs/context.html#dynamic-context

Redux-React Programming Practices [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I am trying to understand the best practices when writing and achieving the best abstraction. Should all functions be action creators when writing redux-react applications, or should functions where it is not necessary to edit the store go directly into components and be called from there?
Action creators are for managing state. They are a very specific type of function that generate actions that are processed by your reducer. There are a lot of other computations and things you can do in your app besides manage state, and for those things you should not use action creators. You don’t necessarily have to put the functions in your components. You can also put them in a helper folder, for example, and then import them.

Resources