Closed HunterWhiteDev closed 1 year ago
Without running your code I won't be able to tell you exactly what's wrong, but a few notes:
request.data.results
before looping on itArray.forEach()
, it's quite a bit slower than a regular for...
loop.setState
within a loop, or if you must, debounce the function call. I believe react has to re-render on most state changes.As far as why the movieTrailer
isn't working, it is an async function so if you aren't using .then()
then you'll need await
(it looks like you've done this properly in your code).
Let me know if you're still having issues, I can help debug.
Closing as stale
Hello lacymorrow, I am trying to build a netflix clone for my portfolio as I have been teaching myself programming, I am using TMDB to create well, what I think looks like a pretty good netflix clone, at least for myself, anyways... I have the movies pulled from the database and I have a function that when I click on a movie it will run movie-trailer on it with it's id, that's fine and it I have it showing up and gives me an trailer url for most of the videos, but when I try to only add videos into movies array with the video url it doesn't work or it bugs out and says .map is not a function. Here is my code:
Not sure if this is not the most appropriate place, but I just really need help I am not sure if this is because I don't understand how to add to an array in React, or maybe it something to do with movie-trailer needing to be async or something with a promise, idk I am just stuck and have been working for 2 days any help would be appreciated!