Replacing accountNumber with a new API field
API development was already completed to accept the new token when called.
Should I use multiple map functions or just one
I’m currently using an NFL Api to create an analytics website. I’m trying to map through 3 separate arrays in my react component. One of the arrays is holding names of players I retrieved from the API fetchFullNames
. Another array is holding hrefs of the player’s headshots fetchImages
. And then one array’s holding the id for each player quarterbacks
. In my return statement is where I am trying to map through each of these arrays displaying 5 cards, one for each player containing their name and headshot. My code right now is displaying the same player’s name multiple times and is also displaying the same player’s headshot multiple times. I’m wondering if I should be using just one map function for all the data in my return statement.
How to use .length in react with map functions
So, I have an array of 5 people and I’m able to fetch their names and images displaying them on a page in react. I was able to do this using one asynchronous function each for the name and image. I then had two other functions that returned the names and hrefs in arrays. I’m now trying to have a card for each person displaying their name and image inside the card. I believe this can be done with the .length
function but I’m not entirely sure. The way my code works now is it only has one card and displays all 5 people in that single card. What I’m trying to do is get the length of the quarterback’s array and display a card for each item in that array.
Getting the error `Cannot read properties of undefined (reading ‘then’)`
I’m trying to use two separate map functions to loop through an array called quarterbacks and display their name and image inside a card. I had this code block working with just names in cards displaying the names as links that went to each individual player’s page. Now that I am trying to implement the images though it seems it’s not fetching the images the same way it did with just the names.
Unable to add request-header to POST request
I am hitting the API by using payload and in headers giving Content-Type : 'application/json'
still in browser in request headers I’m seeing Content-Type : 'text/plain'
Is there any website to obtain array of data for frontend display?
This might sound strange but I am currently learning React and I wanted to know if there is a website to download movies, rating, names, etc as an array of data to use for the frontend. I have seen Ecommerce tutorials (they have an array of data and the images to display on React).
when i call the data from a fetch call, one section will throw an error, but still log in the console correctly, while every other section works fine
im using the DND5E API and react. i call the data and save it to a variable called primaryChoices
, which is an array starting at `proficiency_choices in the api under the classes section (https://www.dnd5eapi.co/api/classes/monk).