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
ListOfTasks: display the tasks and also you have a button to create more (and add them to the list)
TaskCard: display the task and also have an X to delete it
My question is what is the recommended way to handle an optimistic list of elements, because the ListOfEl is responsable for displaying and adding elements using useOptimisticAction, but the ElCard triggers a delete and we need to update the optimistic list.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi there,
I was wondering, how can we do what's stated in this question? In this case the OP is using react useOptimistic:
Consider this scenario:
My question is what is the recommended way to handle an optimistic list of elements, because the
ListOfEl
is responsable for displaying and adding elements using useOptimisticAction, but theElCard
triggers a delete and we need to update the optimistic list.Thanks a lot!
Beta Was this translation helpful? Give feedback.
All reactions