Handle large number of rows in react native [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
TechStack:
React Native
Redux
One of my screen in react native app has list of people registered in the application. It can have thousands of rows. I am planning to have a infinite scroll. What i am concerned is how to keep those rows.
Shall i use redux to keep the rows in the state or shall i store them in a simple variable that keeps on updating.

It depends on what kinda features your list has.
if your list is only for display, simply store your list inside useState.
if your list items have a very nested component structure until
using data to display,
redux can help you to prevent prop drilling.
if your data can change from many places and you are worried about losing tracking of data
redux can help you.

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 is the need of redux in react? [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 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.

Is it worth to use redux on tables? [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 2 years ago.
Improve this question
I'm trying to build an application which will be formed by several CRUD and several graphic tables (similar to excel and containing hundreds of rows) which will be editable by users.
I've already created a CRUD with react and redux, now I'm wondering if the tables should be implemented with redux as well or not.
Thinking about it a jsx row of a table is like an element of CRUD, in fact I need to be able to Create a new row, Read, Update and Delete it.
Is it correct to use redux (and so create all the logic needed, reducers actions ..)for editable tables? Is there a best practice or a standard approach for this case ?
You should take a look on Material Table. It has built-in feature for table editing.
About the connection Redux-Table, it totally up to you. If the data displayed in the table come from the store and you want to keep them there (to not call an api, if any, to get updated data) you should write all the redux stuff (reducer, actions...).
Hope it helps.

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

Fetching data from database(React.js) [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
In my app, some components use different categories of data(clothes, shoes etc.).
Is it better to fetch data from database once and put it to storage? Or i should let every single component fetch data directly from database?
You're looking for Redux (an implementation of flux). Redux gives you a global state to work with that you can connect components into. You can make an api call in one component, and if added to state (using actions + reducers), you can update data from a completely different component. They don't even need a parent/child relationship in your component hierarchy.
So yes, you're looking for "storage", in the form of a global state for your entire React app.

Resources