You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.
Hi @kentcdodds
I followed you article in here: https://kentcdodds.com/blog/how-to-use-react-context-effectively
and it has been a huge help, but as the title says, I am kind of missing computed properties or getters. Let me give you an example:
Imagine you have an array of items, and you can select one to do stuff with it. So you could have this state on a reducer:
which duplicates state, or you could have something like this:
and from there derive the
selectedItem
in a computed property or getter of sorts, and avoid duplicating state.Do you have any idea how this could be accomplished? Do you think it's even worth it?
The text was updated successfully, but these errors were encountered: