Select data from Redux store #3302
Unanswered
armandocin
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I use React-Table to create a re-usable table component, and use this in several pages that create their own columns array and pass the data loaded from api.
Now What I'm wondering is: is it logically correct to get some data from the Redux store directly using
useSelector
in the component passed toCell
oraccessor
property?E.g.
The table renders data from array of
orders
loaded from API. One of the cells of this table is theAccount
that made the order, and the value for this column got by the accessor is just an ID.Now, assuming that in Redux I've already loaded the accounts, I want to select from Redux the corresponding account object using
useSelect
and the ID.Is this a good pattern?
Thanks for your help
Beta Was this translation helpful? Give feedback.
All reactions