Answer the question
In order to leave comments, you need to log in
What is the best way to select an element from a list in Redux?
Hello.
There is a list component Persons , there is a component Person , which reflects information on the selected person.
The question is what is better to send to the activeID state, and then sort through the array in the container, or immediately when clicking, transfer the desired object from the table to activeItem
Usually I solve such problems in the first way, but passing the object right away seemed easier.
Actually, two things confuse:
1. There is little experience, but looking through other people's codes I have not seen that an object is usually passed immediately id.
2. The state tree itself begins to duplicate data - the Persons array already contains the Person element.
Also, the question arose where is it better to sort and filter elements in reducers or in containers?
PS I apologize in advance if I did not explain clearly, if necessary I will post the code.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question