I’m trying to write a function that builds an array where each value of the array is a value pulled from an API using a unique url, once the value is fetched from the API it is pushed into the existing array. Basically when the function is called I want to populate an array with fetched API data for each
Tag: reactjs
ReactJS cannot display image from backend folder using node.js
I’m new in React.js and I have some data (actions) coming from database. Every action has an array of images. I cannot display the images in image tag. Images are stored in a the backend folder structure like below: I was reading some questions and tried to use express.static() but it didn’t work for me: server.ts frontend I tried usgin
How to Map objects inside an array – Javascript
This is for a React Native Chat app. My data should be something like this: I am listing the Chat list using a FlatList: The messages shows like this all stacked up and I am not what is the workaround. What I am trying to achieve is displaying the last message based on timestamp. Answer To get the last message
Setting the size for an antd select component options list
The HTML select element uses an attribute size to determine how many rows should be visible at one time in a scrolling select element. The code below uses size=”4″ to show 4 options at once. I would like to know how to get that same functionality using the Ant Design Select component in a React app. I’ve tried setting the
Objects not getting stored into localstorage. – React JS
So I’m trying to make a web application which fetches products from backend API and displays it and I’m also trying to implement add to cart functionality which works by storing products added to the cart by the user in their local storage When I click add to cart this is what gets added currently cartItems [{}] which is not
Send data between components in ReactJs using Apollo Client
According to the documentation, GraphQl provides state management like Redux. I have 2 components. In the Component1 i get data from the server using AppoloClient, it works ok, and in the Component2 i want to read data from the cache(store). Issue: I can get data in component 1, but when I try to read data from component 2, I get
is there a way to make onClick hanlder on a bar on Nivo charts?
I’m new to Nivo.rocks, a react based charts library. Im trying to add a click handler to a bar to just console.log the data on that bar. currently the component comes with its own ‘tool tip’ that shows this data when you hover over a bar but i dont want that. I’ve looked at the documentation but it doesnt show
how to ovelap a image on other image by styling scss in reactjs?
I have a design. In this design, one is overlapping on another image. I have created some code to try as given in the design. but it’s not working for me. Click here to find the design Below is some line of code of components. that is tried by me below is a style in scss Click Here to check
Does React not work with js Set:s (the datatype)?
I’m trying to use the js Set datastructure with React but it will not update like I thought it would. Consider the following two two examples. Buttons are supposed to go green when pressed. The first one with a Set (NOT WORKING) And the same example but with an array instead (WORKING) Answer React decides whether to rerender through comparing
React + TS – pass parameters with redirect
Hello i have application where i want to redirect user after successfully create a new room. I want to redirect him to page with room ID in URL, but i want to send data with this redirect to the component state. in App.tsx i have im redirect from CreateRoom component like this that works fine and redirect me. this is