Home > database >  How to share and update array of objects between 2 components
How to share and update array of objects between 2 components

Time:11-25

I wonder if anyone can help?

I have a list of base users that I fetch from an API and render to the page via the Dashboard component.

I want to create another list, in a separate route/component (Favorites), that allows for a user to create a personalized user list, like a list of favorites.

At the moment, I am stuck on what to now do with the array of favorites. How do I get the array sharable from Dashboard to Favorites? Could I create a context? But how would that look?

Below is my dashboard component that contains the base list and the favorites.

A sandbox is Edit black-rain-q9p5fn

  • Related