M
M
mrrangerr2020-02-12 14:59:20
React
mrrangerr, 2020-02-12 14:59:20

How to pass data from one component to another component?

Good afternoon everyone. I have a component with a photo, in this component there is a button for adding a photo to "Favorites". I want to have a separate page with a list of selected photos. And how can I transfer photos added to favorites to this list?

5e43e8906fa41678356543.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Klein Maximus, 2020-02-12
@mrrangerr

You need to arrange the global storage in some way and add your favorite photos there. This can be done with Redux, MobX, etc., but the easiest way is through React Context .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question