No update when switching between tabs

Hi guys,

I have 2 tabs:

first tab: I display some items, let’s say fruit names alongside a checkbox.
When the checkbox is checked the item is added into a list from FruitProvider (for example): favoriteFruits

second tab: I display the favoriteFruits list alongside a checked checkbox.

If I uncheck a fruit from the second tab, in the first tab it will still appear as checked…
Do you have any idea how to solve this?
I know that i can just fetch the fruits from server again but I do not want that, i want the list and its items to remain in the same position as they were when i switched to the second tab

Thank you

you can use the context api - source code running in code sandbox and example here

1 Like

thank you,
But I already have the code written using useContext(…), useReducer(…) and useState(…) but still no update…

How about you show the code and then maybe someone can help you out?