So I know the http call works and the if statements work and return what I expect them to. So my question is, is it possible to take the data stored in the variables and pass it to the SingleChannel component as props? Obviously this doesn’t work the way I have it now but is this even possible to do? Am I on the right track?
It’s possible to access the data just the way you have it. You can access the props in SingleChannel using this.props.channel and this.props.streaming. Another way you can do it is pass the return values as an object and access it from the SingleChannel that way. So it will be something like this.
Thank you for the help with cleaning up my code but I still have an issue…So if I add the ‘channelValues’ prop with propVals as the value on the SingleChannel component I’m getting undefined. It looks like its returning the SingleChannel component before _request is returning the object to propVals so it’s undefined. I only think that because if I console.log(propVals) instead of returning the component, it says undefined.
Yea I was getting _request undefined but I figured that out…what I’m trying to say is that after I assign propVals to the _request method if I console.log(propVals) it says undefined. The if statements return what’s expected though so those are working. It seems that renderChannels() is returning the component before propVals has the object. Is there a way to hold off on the return of SingleChannel until propVals has the object?