i am trying to convert class component into a functional component , basically displaying all the nft’s with map function using dummy data which i have declared. can anyone guide me through this . I’ve been getting this error . TypeError: nfts.map is not a function Responsive src/components/compon…
Tag: reactjs
Add line break between buttons generated in react loop
I a trying to add a line break after a button that is generated in a react loop. I’ve tried adding elements but that has not worked: There should be a space between the buttons. Currently they are stacked without spacing. Answer This approach worked, but only by adding margin-bottom:
Getting an array of Promises after async await
i’m trying to create an array of the daily forecast mapping over an array with cities. I’m trying to map over the array of the cities making an api call for each one of them once the page loads. I keep on getting an array of Promises such as this : Favorite Page component: Service with the api cal…
Material UI checkbox toggle value based off input from object
I have an unchecked checkbox. I am trying to change the value of it based off of data from an object. The object is from an SQL select boolean column ‘T’ or ‘F’. If the value is ‘T’ then the box would be checked vise versa. I tried using a useState() that viewed the value b…
how can I display a list of contacts with name, age, location, and phone props in react? my code does not display anything
there are three components namely; AddPersonForm, PeopleIst, and ContactManager AddPersonForm is a form with the text field and add button and uses state to manage the value of the text field PeopleList is a list of contacts and receives an array representing the contacts and renders a list on the page Contac…
setting state within nested response
I am building a react app and I am setting the state with api of nested response of nested state But the state is not setting the way I want. response that is receiving from api App.js What is the problem ? Images are not showing after Title. I am trying to show all images in BlogList class of every
Given Two async functions, which function runs first?
Let’s say I have two async functions func1 and func2. Both functions are asynchronous and update the counter state. func1 runs before func2. Questions: Is it guaranteed that when func2’s useState runs, the Counter’s state is updated by func1? Please keep in mind both functions are asynchrono…
Axios Request returns 404 even though URL is valid and the API functions correctly [closed]
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed 9 m…
React Js Components imported but not displaying
I have two components ‘footer’ and ‘header’ in the components directory. It imports properly but I am not able to display it. App.js header.js footer.js The output is just this Answer Your components must start with a capital letter, if not they will be treated like a regular html tags…
Access to fetch at ‘https://localhost:7144/api/employees’ from origin ‘http://localhost:3000’ has been blocked by CORS policy
Im getting this error when I try to fetch data from webapi to display in react js Here is a photo when I check the console this is what I get here is my program.cs here is one of my files employee.js I believe the issue has to deal with the CORS Policy, but have tried everything. Does anything stand