I have doubts with the use of react-router

1

Good friends, I am using the YouTube app to get the videos, the problem is that I'm using react-router, I have my Show component where I have my tag that is going to call my Reproductive component but there is a problem because my Reproductive component I want to get data (title of the video, x value) but the way to send data is through the props, but I can not send it that way because I do not want to show me the video if not until I call to my route.

I will leave the components where I have the doubts hopefully you can help me please I have not found a clear help with this

I already get the corresponding video, what I need is to send you data to get the name of the video and another list of videos that are related. Help please

    
asked by Manuel Galindez 13.08.2016 в 14:53
source

1 answer

2

There are different solutions, depending on how you are managing the status of your app. The most common is to implement the architecture proposed by Facebook, Flux , there are numerous libraries that will make your work easier. Another option (and the one that personally convinces me the most) is to use observables , Mobx is a library that makes the task much easier. As a last option (and not very recommendable) you could store the properties that you need to 'share' in global variables and thus they will be available where you need them.

    
answered by 24.08.2016 / 14:33
source